if (resourceIndex == null)
{
return;
}
AnnotationFinder<AnnotatedElement> finder = new DefaultAnnotationFinder<AnnotatedElement>();
Web30MetaDataCreator creator = new Web30MetaDataCreator(finder);
// Merge processed annotations from all scopes
Set<Class<? extends Annotation>> annotations = new HashSet<Class<? extends Annotation>>();
AnnotationContext annotationContext = creator.getAnnotationContext();
if (annotationContext.getTypeAnnotations() != null)
annotations.addAll(annotationContext.getTypeAnnotations());
if (annotationContext.getMethodAnnotations() != null)
annotations.addAll(annotationContext.getMethodAnnotations());
if (annotationContext.getFieldAnnotations() != null)
annotations.addAll(annotationContext.getFieldAnnotations());
Collection<Class<?>> specEligibleResourceInjectionClasses = this.getResourceInjectionEligibleWebAppClasses(resourceIndex, classpath);
if (specEligibleResourceInjectionClasses.isEmpty())
{
return;
}
boolean metaData = false;
for (VirtualFile path : classpath)
{
Collection<Class<?>> eligibleAnnotatedClasses = new HashSet<Class<?>>();
for (Class<? extends Annotation> annotation : annotations)
{
Collection<Class<?>> annotatedClasses = resourceIndex.getAnnotatedClasses(path, annotation);
eligibleAnnotatedClasses.addAll(this.retainResourceInjectionEligibleWebAppClasses(specEligibleResourceInjectionClasses, annotatedClasses));
}
WebMetaData annotationMetaData = creator.create(eligibleAnnotatedClasses);
if (annotationMetaData != null)
{
unit.addAttachment(WEB_ANNOTATED_ATTACHMENT_NAME + ":" + path.getName(), annotationMetaData,
WebMetaData.class);
metaData = true;