@SuppressWarnings("unchecked") public void process(Component<?> component, Class clazz, IntrospectionContext context) { String implementationType = "java"; // default to Java the implementation type for (Annotation annotation : clazz.getAnnotations()) { Implementation implementation = annotation.annotationType().getAnnotation(Implementation.class); if (implementation != null) { implementationType = implementation.value(); break; } else { for (ComponentAnnotationMapper mapper : mappers) { String alias = mapper.getImplementationType(annotation); if (alias != null) { implementationType = alias; break; } } } } ImplementationProcessor processor = implementationProcessors.get(implementationType); if (processor == null) { context.addError(new UnknownImplementation("Unknown implementation type: " + implementationType)); return; } processor.process(component, clazz, context); } }