@Override
public boolean process(
final Set<? extends TypeElement> annotations,
final RoundEnvironment roundEnvironment) {
AnnotationApiHelper typeHelper = new AnnotationApiHelper(
processingEnv.getElementUtils(), processingEnv.getTypeUtils()
);
ElementVisitor<Void, List<AnnotationMirror>> visitor = new ConstraintAnnotationVisitor(
processingEnv, messager, configuration
);
for ( TypeElement oneAnnotation : annotations ) {
//Indicates that the annotation's type isn't on the class path of the compiled
//project. Let the compiler deal with that and print an appropriate error.
if ( oneAnnotation.getKind() != ElementKind.ANNOTATION_TYPE ) {
continue;
}
Set<? extends Element> elementsWithConstraintAnnotation =
roundEnvironment.getElementsAnnotatedWith( oneAnnotation );
for ( Element oneAnnotatedElement : elementsWithConstraintAnnotation ) {
List<AnnotationMirror> mirrorsOfCurrentAnnotation =
typeHelper.filterByType( oneAnnotatedElement.getAnnotationMirrors(), oneAnnotation.asType() );
oneAnnotatedElement.accept( visitor, mirrorsOfCurrentAnnotation );
}
}