generator.accept(program);
final Map<JsName, JMethod> nameToMethodMap = new HashMap<JsName, JMethod>();
final HashMap<JsName, JField> nameToFieldMap = new HashMap<JsName, JField>();
final HashMap<JsName, JReferenceType> constructorNameToTypeMap = new HashMap<JsName, JReferenceType>();
for (JDeclaredType type : program.getDeclaredTypes()) {
JsName typeName = names.get(type);
if (typeName != null) {
constructorNameToTypeMap.put(typeName, type);
}
for (JField field : type.getFields()) {
if (field.isStatic()) {
JsName fieldName = names.get(field);
if (fieldName != null) {
nameToFieldMap.put(fieldName, field);
}
}
}
for (JMethod method : type.getMethods()) {
JsName methodName = names.get(method);
if (methodName != null) {
nameToMethodMap.put(methodName, method);
}
}
}