}
}
// @MultipartConfig
final List<AnnotationTarget> multipartConfigAnnotationTargets = index.getAnnotationTargets(multipartConfig);
if (multipartConfigAnnotationTargets != null && multipartConfigAnnotationTargets.size() > 0) {
MultipartConfigProcessor processor = new MultipartConfigProcessor(finder);
AnnotationsMetaData annotations = metaData.getAnnotations();
if (annotations == null) {
annotations = new AnnotationsMetaData();
metaData.setAnnotations(annotations);
}
for (final AnnotationTarget target : multipartConfigAnnotationTargets) {
if (!(target instanceof ClassInfo)) {
throw new DeploymentUnitProcessingException("@MultipartConfig is only allowed at class level " + target);
}
ClassInfo classInfo = ClassInfo.class.cast(target);
Class<?> type = null;
try {
type = classLoader.loadClass(classInfo.name().toString());
} catch (Exception e) {
throw new DeploymentUnitProcessingException("Could not process @MultipartConfig on " + target);
}
if (type != null) {
processor.process(annotations, type);
}
}
}
// @ServletSecurity
final List<AnnotationTarget> servletSecurityAnnotationTargets = index.getAnnotationTargets(servletSecurity);
if (servletSecurityAnnotationTargets != null && servletSecurityAnnotationTargets.size() > 0) {
ServletSecurityProcessor processor = new ServletSecurityProcessor(finder);
AnnotationsMetaData annotations = metaData.getAnnotations();
if (annotations == null) {
annotations = new AnnotationsMetaData();
metaData.setAnnotations(annotations);
}
for (final AnnotationTarget target : servletSecurityAnnotationTargets) {
if (!(target instanceof ClassInfo)) {
throw new DeploymentUnitProcessingException("@ServletSecurity is only allowed at class level " + target);
}
ClassInfo classInfo = ClassInfo.class.cast(target);
Class<?> type = null;
try {
type = classLoader.loadClass(classInfo.name().toString());
} catch (Exception e) {
throw new DeploymentUnitProcessingException("Could not process @ServletSecurity on " + target);
}
if (type != null) {
processor.process(annotations, type);
}
}
}
return metaData;
}