log.trace("Cannot scan classes, missing AnnotationRepository as attachment: " + unit.getName());
return Collections.emptySet();
}
String creatorInfo = creator.toString();
AnnotationContext context = creator.getAnnotationContext();
Set<Class<?>> classes = new HashSet<Class<?>>();
Collection<Class<? extends Annotation>> typeAnnotations = context.getTypeAnnotations();
if (trace)
log.trace("Creator: " + creatorInfo + ", type annotations: " + typeAnnotations);
for(Class<? extends Annotation> annotation : typeAnnotations)
{
Class<Annotation> annotationClass = (Class<Annotation>)annotation;
Set<Element<Annotation, Class<?>>> elements = env.classIsAnnotatedWith(annotationClass);
for(Element<Annotation, Class<?>> elt : elements)
classes.add(elt.getOwner());
}
Collection<Class<? extends Annotation>> methodAnnotations = context.getMethodAnnotations();
if (trace)
log.trace("Creator: " + creatorInfo + ", method annotations: " + methodAnnotations);
for(Class<? extends Annotation> annotation : methodAnnotations)
{
Class<Annotation> annotationClass = (Class<Annotation>)annotation;
Set<Element<Annotation, Method>> elements = env.classHasMethodAnnotatedWith(annotationClass);
for(Element<Annotation, Method> elt : elements)
classes.add(elt.getOwner());
}
Collection<Class<? extends Annotation>> fieldAnnotations = context.getFieldAnnotations();
if (trace)
log.trace("Creator: " + creatorInfo + ", field annotations: " + fieldAnnotations);
for(Class<? extends Annotation> annotation : fieldAnnotations)
{
Class<Annotation> annotationClass = (Class<Annotation>)annotation;