final String name = nameValue != null ? nameValue.asString() : null;
final AnnotationValue typeValue = annotation.value("type");
final String type = typeValue != null ? typeValue.asClass().name().toString() : null;
if (annotationTarget instanceof FieldInfo) {
FieldInfo fieldInfo = (FieldInfo) annotationTarget;
ClassInfo classInfo = fieldInfo.declaringClass();
EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
processFieldResource(phaseContext, fieldInfo, name, type, classDescription, annotation, eeModuleDescription, module, applicationClasses);
} else if (annotationTarget instanceof MethodInfo) {
MethodInfo methodInfo = (MethodInfo) annotationTarget;
ClassInfo classInfo = methodInfo.declaringClass();
EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
processMethodResource(phaseContext, methodInfo, name, type, classDescription, annotation, eeModuleDescription, module, applicationClasses);
} else if (annotationTarget instanceof ClassInfo) {
ClassInfo classInfo = (ClassInfo) annotationTarget;
EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
processClassResource(phaseContext, name, type, classDescription, annotation, eeModuleDescription, module, applicationClasses);
}
}
final List<AnnotationInstance> resourcesAnnotations = index.getAnnotations(RESOURCES_ANNOTATION_NAME);
for (AnnotationInstance outerAnnotation : resourcesAnnotations) {
final AnnotationTarget annotationTarget = outerAnnotation.target();
if (annotationTarget instanceof ClassInfo) {
final ClassInfo classInfo = (ClassInfo) annotationTarget;
final AnnotationInstance[] values = outerAnnotation.value("value").asNestedArray();
for (AnnotationInstance annotation : values) {
final AnnotationValue nameValue = annotation.value("name");
final String name = nameValue != null ? nameValue.asString() : null;
final AnnotationValue typeValue = annotation.value("type");
final String type = typeValue != null ? typeValue.asClass().name().toString() : null;
EEModuleClassDescription classDescription = applicationClasses.getOrAddClassByName(classInfo.name().toString());
processClassResource(phaseContext, name, type, classDescription, annotation, eeModuleDescription, module, applicationClasses);
}
}
}
}