.implementsInterface(QualifierEqualityFactory.class)
.body();
builder.getClassDefinition().getContext().setPermissiveMode(true);
final MetaClass mapStringAnnoComp
= parameterizedAs(HashMap.class, typeParametersOf(String.class, AnnotationComparator.class));
builder.privateField(COMPARATOR_MAP_VAR, mapStringAnnoComp)
.initializesWith(Stmt.newObject(mapStringAnnoComp)).finish();
final ConstructorBlockBuilder<? extends ClassStructureBuilder<?>> constrBuilder = builder.publicConstructor();
final MetaDataScanner scanner = ScannerSingleton.getOrCreateInstance();
final Set<Class<?>> typesAnnotatedWith = scanner.getTypesAnnotatedWith(Qualifier.class);
typesAnnotatedWith.add(Named.class);
for (final Class<?> aClass : typesAnnotatedWith) {
try {
final MetaClass MC_annotationClass = GWTClass.newInstance(oracle, oracle.getType(aClass.getName()));
final Collection<MetaMethod> methods = getAnnotationAttributes(MC_annotationClass);
if (methods.isEmpty()) continue;
constrBuilder._(Stmt.loadVariable(COMPARATOR_MAP_VAR)
.invoke("put", aClass.getName(), generateComparatorFor(MC_annotationClass, methods)));
}
catch (NotFoundException e) {
// ignore.
}
}
// finish constructor
constrBuilder.finish();
final MetaClass annotationClazz = JavaReflectionClass.newUncachedInstance(Annotation.class);
builder.publicMethod(boolean.class, "isEqual",
Parameter.of(annotationClazz, "a1"), Parameter.of(annotationClazz, "a2"))
.body()
._(If.cond(invokeStatic(QualifierUtil.class, "isSameType", Refs.get("a1"), Refs.get("a2")))
._(