clazz = ClassUtil.getClassFromName(child.getTextContent().trim());
if (clazz == null)
{
throw new WebBeansConfigurationException(createConfigurationFailedMessage() + "Interceptor class : " +
child.getTextContent().trim() + " not found");
}
else
{
Annotation[] classAnnotations;
AnnotatedType<?> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(clazz);
ProcessAnnotatedTypeImpl<?> processAnnotatedEvent =
webBeansContext.getWebBeansUtil().fireProcessAnnotatedTypeEvent(annotatedType);
// if veto() is called
if (processAnnotatedEvent.isVeto())
{
return;
}
annotatedType = processAnnotatedEvent.getAnnotatedType();
Set<Annotation> annTypeAnnotations = annotatedType.getAnnotations();
if (annTypeAnnotations != null)
{
classAnnotations = annTypeAnnotations.toArray(new Annotation[annTypeAnnotations.size()]);
}
else
{
classAnnotations = new Annotation[0];
}
if (AnnotationUtil.hasAnnotation(classAnnotations, Interceptor.class) &&
!webBeansContext.getAnnotationManager().
hasInterceptorBindingMetaAnnotation(classAnnotations))
{
throw new WebBeansConfigurationException(createConfigurationFailedMessage() + "Interceptor class : "
+ child.getTextContent().trim()
+ " must have at least one @InterceptorBinding");
}
// check if the interceptor got defined twice in this beans.xml
if (interceptorsInFile.contains(clazz))
{
throw new WebBeansConfigurationException(createConfigurationFailedMessage() + "Interceptor class : "
+ child.getTextContent().trim()
+ " already defined in this beans.xml file!");
}
interceptorsInFile.add(clazz);