private void addNewInterceptorBindingType(Element interceptorBindingTypeElement)
{
Class<?> clazz = XMLUtil.getElementJavaType(interceptorBindingTypeElement);
if (clazz == null)
{
throw new NonexistentTypeException(createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getName() + " not found");
}
Class<? extends Annotation> clazzAnnot = null;
if (!clazz.isAnnotation())
{
throw new WebBeansConfigurationException(createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getName() + " is not an annotation type");
}
else
{
clazzAnnot = (Class<? extends Annotation>) clazz;
}
if (xmlAnnotTypeManager.isInterceptorBindingTypeExist(clazzAnnot))
{
throw new DeploymentException(createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + interceptorBindingTypeElement.getName() + " is already defined in the XML");
}
List<Element> childs = interceptorBindingTypeElement.elements();
for (Element child : childs)
{
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))
{
throw new WebBeansConfigurationException(createConfigurationFailedMessage() + "InterceptorBinding type with given class : " + XMLUtil.getElementJavaClassName(child) + " is not interceptor binding annotation type");