private void addNewInterceptorBindingType(Element interceptorBindingTypeElement)
{
Class<?> clazz = XMLUtil.getElementJavaType(interceptorBindingTypeElement);
if (clazz == null)
{
throw new NonexistentTypeException(
createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getLocalName() + " not found");
}
Class<? extends Annotation> clazzAnnot = null;
if (!clazz.isAnnotation())
{
throw new WebBeansConfigurationException(
createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getLocalName() +
" is not an annotation type");
}
else
{
clazzAnnot = (Class<? extends Annotation>) clazz;
}
if (xmlAnnotTypeManager.hasInterceptorBindingType(clazzAnnot))
{
throw new DeploymentException(createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getLocalName() +
" is already defined in the XML");
}
Node node;
Element child;
NodeList ns = interceptorBindingTypeElement.getChildNodes();
for (int i = 0; i < ns.getLength(); i++)
{
node = ns.item(i);
if (!(node instanceof Element))
{
continue;
}
child = (Element) node;
Class<?> clz = XMLUtil.getElementJavaType(child);
if (clz == null)
{
throw new NonexistentTypeException(
createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + XMLUtil.getElementJavaClassName(child) + " not found " +
"in namespace : " + XMLUtil.getElementNameSpace(child));
}
if (!clz.isAnnotation() || !AnnotationUtil.isInterceptorBindingAnnotation((Class<? extends Annotation>) clz))