List<StringLiteral> keys = new ArrayList<StringLiteral>();
List<Expression> vals = new ArrayList<Expression>();
Map<String, Set<JMethod>> methodGroups =
getMethodGroups(beanInfo.getMethods());
for (String name : methodGroups.keySet()) {
keys.add(new StringLiteral(FilePosition.UNKNOWN, name));
vals.add(getPropertyDescriptorForMethodGroup(methodGroups.get(name)));
}
for (GwtBeanPropertyDescriptor pd : beanInfo.getProperties()) {
keys.add(new StringLiteral(FilePosition.UNKNOWN, pd.name));
vals.add(getPropertyDescriptorForProperty(pd));
}
for (JField field : beanInfo.getPublicInstanceFields()) {
keys.add(new StringLiteral(FilePosition.UNKNOWN, field.getName()));
vals.add(getPropertyDescriptorForField(field));
}
return QuasiBuilder.substV(
"return $wnd.caja.makeDefensibleObject___({ @keys*: @vals* });",
"keys", new ParseTreeNodeContainer(keys),