openwebbeans-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From strub...@apache.org
Subject svn commit: r952910 [3/3] - in /openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans: corespi/scanner/ corespi/se/ decorator/ deployment/ el/ event/ inject/xml/ intercept/ util/ xml/
Date Wed, 09 Jun 2010 06:32:09 GMT
Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLDefinitionUtil.java Wed Jun  9 06:32:08 2010
@@ -97,12 +97,14 @@ public final class XMLDefinitionUtil
 
         if (ClassUtil.isDefinitionConstainsTypeVariables(clazz))
         {
-            throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName() + " can not be parametrized type");
+            throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName()
+                                                     + " can not be parametrized type");
         }
 
         if (!ClassUtil.isStatic(modifier) && ClassUtil.isInnerClazz(clazz))
         {
-            throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName() + " can not be non-static inner class");
+            throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName()
+                                                     + " can not be non-static inner class");
         }
 
         if (clazz.isAnnotationPresent(javax.interceptor.Interceptor.class))
@@ -110,7 +112,9 @@ public final class XMLDefinitionUtil
             boolean found = XMLUtil.hasChildElementWithWebBeansNameSpace(webBeanDecleration, WebBeansConstants.WEB_BEANS_XML_INTERCEPTOR_ELEMENT);
             if (!found)
             {
-                throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName() + " must be declared as <Interceptor> element in the XML");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "Simple WebBeans component implementation class : " + clazz.getName()
+                        + " must be declared as <Interceptor> element in the XML");
             }
         }
 
@@ -119,7 +123,9 @@ public final class XMLDefinitionUtil
             boolean found = XMLUtil.hasChildElementWithWebBeansNameSpace(webBeanDecleration, WebBeansConstants.WEB_BEANS_XML_DECORATOR_ELEMENT);
             if (!found)
             {
-                throw new WebBeansConfigurationException(errorMessage + "Simple WebBeans component implementation class : " + clazz.getName() + " must be declared as <Decorator> element in the XML");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "Simple WebBeans component implementation class : " + clazz.getName()
+                        + " must be declared as <Decorator> element in the XML");
             }
         }
 
@@ -134,19 +140,20 @@ public final class XMLDefinitionUtil
             {
                 Class<? extends Annotation> clazz = it.next();
                 if (clazz.isAnnotationPresent(NormalScope.class)
-                        || clazz.isAnnotationPresent(Scope.class)
-                        || AnnotationUtil.isQualifierAnnotation(clazz)
-                        || AnnotationUtil.isInterceptorBindingAnnotation(clazz)
-                        || AnnotationUtil.isStereoTypeAnnotation(clazz)
-                        || clazz.equals(Named.class)
-                        || clazz.equals(Specializes.class) || clazz.equals(javax.interceptor.Interceptor.class)
-                        || clazz.equals(Decorator.class))
+                    || clazz.isAnnotationPresent(Scope.class)
+                    || AnnotationUtil.isQualifierAnnotation(clazz)
+                    || AnnotationUtil.isInterceptorBindingAnnotation(clazz)
+                    || AnnotationUtil.isStereoTypeAnnotation(clazz)
+                    || clazz.equals(Named.class)
+                    || clazz.equals(Specializes.class) || clazz.equals(javax.interceptor.Interceptor.class)
+                    || clazz.equals(Decorator.class))
                 {
                     continue;
                 }
                 else
                 {
-                    throw new WebBeansConfigurationException(errorMessage + " TypeLevelMeta data configuration is failed because of the class : " + clazz.getName() + " is not applicable type");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + " TypeLevelMeta data configuration is failed because of the class : " + clazz.getName() + " is not applicable type");
                 }
             }
         }
@@ -157,14 +164,15 @@ public final class XMLDefinitionUtil
      * Gets applicable annotation class for given defineType parameter from the
      * given annotation set.
      *
-     * @param component webbeans component
+     * @param component     webbeans component
      * @param annotationSet type-level metadata annotation set
-     * @param defineType annotation type class
-     * @param errorMessage error message for the operation
+     * @param defineType    annotation type class
+     * @param errorMessage  error message for the operation
      * @return applicable annotation class for given defineType parameter from
      *         the given set
      */
-    public static <T> Class<? extends Annotation> defineXMLTypeMetaData(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet, Class<? extends Annotation> defineType, String errorMessage)
+    public static <T> Class<? extends Annotation> defineXMLTypeMetaData(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet,
+                                                                        Class<? extends Annotation> defineType, String errorMessage)
     {
         // Found annotation for given defineType parameter
         Class<? extends Annotation> metaType = null;
@@ -191,7 +199,8 @@ public final class XMLDefinitionUtil
         return metaType;
     }
 
-    public static <T> boolean defineXMLBindingType(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
+    public static <T> boolean defineXMLBindingType(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet,
+                                                   List<Element> annotationElementList, String errorMessage)
     {
         Iterator<Class<? extends Annotation>> it = annotationSet.iterator();
         boolean found = false;
@@ -210,7 +219,9 @@ public final class XMLDefinitionUtil
                     {
                         if (!AnnotationUtil.hasAnnotation(method.getAnnotations(), Nonbinding.class))
                         {
-                            throw new WebBeansConfigurationException(errorMessage + "WebBeans definition class : " + component.getReturnType().getName() + " @Qualifier : " + temp.getName() + " must have @NonBinding valued members for its array-valued and annotation valued members");
+                            throw new WebBeansConfigurationException(
+                                    errorMessage + "WebBeans definition class : " + component.getReturnType().getName() + " @Qualifier : " + temp.getName() +
+                                    " must have @NonBinding valued members for its array-valued and annotation valued members");
                         }
                     }
                 }
@@ -229,7 +240,8 @@ public final class XMLDefinitionUtil
         return found;
     }
 
-    public static <T> void defineXMLClassLevelInterceptorType(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
+    public static <T> void defineXMLClassLevelInterceptorType(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet,
+                                                              List<Element> annotationElementList, String errorMessage)
     {
         Iterator<Class<? extends Annotation>> it = annotationSet.iterator();
 
@@ -271,16 +283,21 @@ public final class XMLDefinitionUtil
 
     }
 
-    public static <T> void defineXMLMethodLevelInterceptorType(XMLManagedBean<T> component, Method interceptorMethod, Element interceptorMethodElement, String errorMessage)
+    public static <T> void defineXMLMethodLevelInterceptorType(XMLManagedBean<T> component, Method interceptorMethod, Element interceptorMethodElement,
+                                                               String errorMessage)
     {
         Set<Annotation> bindingTypesSet = new HashSet<Annotation>();
-        Node node; Element bindingType;
+        Node node;
+        Element bindingType;
         NodeList ns = interceptorMethodElement.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            bindingType = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            bindingType = (Element) node;
 
             Class<? extends Annotation> annot = (Class<? extends Annotation>) XMLUtil.getElementJavaType(bindingType);
             Annotation bindingAnnot = XMLUtil.getXMLDefinedAnnotationMember(bindingType, annot, errorMessage);
@@ -309,7 +326,7 @@ public final class XMLDefinitionUtil
     /**
      * Configures the webbeans component stereotype.
      *
-     * @param component webbeans component
+     * @param component     webbeans component
      * @param annotationSet set of type-level metadata annotation set
      */
     public static <T> void defineXMLStereoType(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet)
@@ -353,7 +370,8 @@ public final class XMLDefinitionUtil
         }
     }
 
-    public static <T> void defineXMLInterceptors(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
+    public static <T> void defineXMLInterceptors(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet,
+                                                 List<Element> annotationElementList, String errorMessage)
     {
         Iterator<Class<? extends Annotation>> it = annotationSet.iterator();
         boolean found = false;
@@ -367,7 +385,8 @@ public final class XMLDefinitionUtil
             {
                 if (found)
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "More than one <Interceptor> element exist for class : " + component.getReturnType().getName());
+                    throw new WebBeansConfigurationException(errorMessage + "More than one <Interceptor> element exist for class : "
+                                                             + component.getReturnType().getName());
                 }
                 else
                 {
@@ -386,17 +405,21 @@ public final class XMLDefinitionUtil
 
         if (interceptorBindingTypes.size() == 0)
         {
-            throw new WebBeansConfigurationException(errorMessage + "<Interceptor> decleration must have one interceptor binding type for class : " + component.getReturnType().getName());
+            throw new WebBeansConfigurationException(
+                    errorMessage + "<Interceptor> decleration must have one interceptor binding type for class : " + component.getReturnType().getName());
         }
 
         Annotation[] anns = new Annotation[interceptorBindingTypes.size()];
         anns = interceptorBindingTypes.toArray(anns);
-        InterceptorUtil.checkLifecycleConditions(component.getReturnType(), anns, errorMessage + "Lifecycle interceptor : " + component.getReturnType().getName() + " interceptor binding type must be defined as @Target{TYPE}");
+        InterceptorUtil.checkLifecycleConditions(component.getReturnType(), anns, errorMessage + "Lifecycle interceptor : "
+                                                                                  + component.getReturnType().getName() +
+                                                                                  " interceptor binding type must be defined as @Target{TYPE}");
 
         WebBeansInterceptorConfig.configureInterceptorClass((XMLManagedBean<Object>) component, anns);
     }
 
-    public static <T> void defineXMLDecorators(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, Element decoratorDecleration, String errorMessage)
+    public static <T> void defineXMLDecorators(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet,
+                                               Element decoratorDecleration, String errorMessage)
     {
         Iterator<Class<? extends Annotation>> it = annotationSet.iterator();
         boolean found = false;
@@ -418,30 +441,37 @@ public final class XMLDefinitionUtil
 
         if (found)
         {
-            Node node; Element child;
+            Node node;
+            Element child;
             NodeList ns = decoratorDecleration.getChildNodes();
 
-            for(int i=0; i<ns.getLength(); i++)
+            for (int i = 0; i < ns.getLength(); i++)
             {
                 node = ns.item(i);
-                if (!(node instanceof Element)) continue;
-                child = (Element)node;
+                if (!(node instanceof Element))
+                {
+                    continue;
+                }
+                child = (Element) node;
                 if (XMLUtil.getElementNameSpace(child).equals(XMLUtil.getElementNameSpace(decoratorDecleration)) && XMLUtil.isElementHasDecoratesChild(child))
                 {
                     Field field = ClassUtil.getFieldWithName(component.getReturnType(), child.getLocalName());
                     if (field == null)
                     {
-                        throw new NonexistentFieldException(errorMessage + "Field with name : " + child.getLocalName() + " not found in the decorator class : " + component.getReturnType().getName());
+                        throw new NonexistentFieldException(
+                                errorMessage + "Field with name : " + child.getLocalName() + " not found in the decorator class : "
+                                + component.getReturnType().getName());
                     }
                     Element type;
                     NodeList ns1 = child.getElementsByTagName(WebBeansConstants.WEB_BEANS_XML_DECORATES_ELEMENT);
-                    type = (Element)ns1.item(0);
+                    type = (Element) ns1.item(0);
 
                     Class<?> apType = XMLUtil.getElementJavaType(type);
 
                     if (!field.getType().isAssignableFrom(apType))
                     {
-                        throw new WebBeansConfigurationException(errorMessage + "Field name : " + field.getName() + " xml defined class type must be assignable to the field actual class type");
+                        throw new WebBeansConfigurationException(
+                                errorMessage + "Field name : " + field.getName() + " xml defined class type must be assignable to the field actual class type");
                     }
 
                     XMLInjectionPointModel model = XMLUtil.getInjectionPointModel(type, errorMessage);
@@ -459,14 +489,15 @@ public final class XMLDefinitionUtil
     /**
      * Returns newly created and configures xml webbeans producer component.
      *
-     * @param component webbeans component that defines producer method
-     * @param producesMethod producer method
+     * @param component             webbeans component that defines producer method
+     * @param producesMethod        producer method
      * @param producerMethodElement produce method xml element
-     * @param errorMessage error message
+     * @param errorMessage          error message
      * @return newly created and configures xml webbeans producer component.
      * @see XMLProducerBean
      */
-    public static <T> XMLProducerBean<T> defineXMLProducerMethod(WebBeansXMLConfigurator configurator, XMLManagedBean<T> component, Method producesMethod, Element producerMethodElement, String errorMessage)
+    public static <T> XMLProducerBean<T> defineXMLProducerMethod(WebBeansXMLConfigurator configurator, XMLManagedBean<T> component,
+                                                                 Method producesMethod, Element producerMethodElement, String errorMessage)
     {
         boolean producesDefined = false;
         Class<T> type = null;
@@ -476,13 +507,17 @@ public final class XMLDefinitionUtil
         List<Element> memberLevelElement = new ArrayList<Element>();
         List<XMLInjectionPointModel> injectedParameters = new ArrayList<XMLInjectionPointModel>();
 
-        Node node; Element childElement;
+        Node node;
+        Element childElement;
         NodeList ns = producerMethodElement.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            childElement = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            childElement = (Element) node;
             if (XMLUtil.isElementInWebBeansNameSpaceWithName(childElement, WebBeansConstants.WEB_BEANS_XML_PRODUCES_ELEMENT))
             {
                 if (producesDefined == false)
@@ -496,13 +531,17 @@ public final class XMLDefinitionUtil
 
                 boolean definedType = false;
 
-                Node producerNode; Element producesElementChild;
+                Node producerNode;
+                Element producesElementChild;
                 NodeList nsProducer = childElement.getChildNodes();
-                for(int j=0; j<nsProducer.getLength(); j++)
+                for (int j = 0; j < nsProducer.getLength(); j++)
                 {
                     producerNode = nsProducer.item(j);
-                    if (!(producerNode instanceof Element)) continue;
-                    producesElementChild= (Element)producerNode;
+                    if (!(producerNode instanceof Element))
+                    {
+                        continue;
+                    }
+                    producesElementChild = (Element) producerNode;
                     if (producesElementChild.getLocalName().equals(WebBeansConstants.WEB_BEANS_XML_ARRAY_ELEMENT))
                     {
                         arrayElement = producesElementChild;
@@ -513,7 +552,9 @@ public final class XMLDefinitionUtil
                         type = (Class<T>) XMLUtil.getElementJavaType(producesElementChild);
                         if (type == null)
                         {
-                            throw new NonexistentTypeException(errorMessage + "Java type : " + XMLUtil.getElementJavaClassName(producesElementChild) + " does not exist in the <Produces> element child");
+                            throw new NonexistentTypeException(
+                                    errorMessage + "Java type : " + XMLUtil.getElementJavaClassName(producesElementChild)
+                                    + " does not exist in the <Produces> element child");
                         }
 
                         else if (type.isAnnotation())
@@ -525,7 +566,10 @@ public final class XMLDefinitionUtil
                         {
                             if (!type.isAssignableFrom(producesMethod.getReturnType()) && !producesMethod.getReturnType().isAssignableFrom(type))
                             {
-                                throw new WebBeansConfigurationException(errorMessage + "Defined returned method type is not compatible for producer method name : " + producesMethod.getName() + " in class : " + component.getReturnType().getName());
+                                throw new WebBeansConfigurationException(
+                                        errorMessage + "Defined returned method type is not compatible for producer method name : "
+                                        + producesMethod.getName() + " in class : " +
+                                        component.getReturnType().getName());
                             }
 
                             if (definedType)
@@ -554,9 +598,12 @@ public final class XMLDefinitionUtil
             }
         }
 
-        XMLProducerBean<T> producerComponentImpl = configureProducerMethod(component, producesMethod, injectedParameters, type, arrayElement, typeElement, errorMessage);
+        XMLProducerBean<T> producerComponentImpl = configureProducerMethod(component, producesMethod, injectedParameters, type, arrayElement,
+                                                                           typeElement, errorMessage);
 
-        configureProducerTypeLevelMetaData(configurator, producerComponentImpl, producesMethod, producerMethodElement, memberLevelMetaData, memberLevelElement, component, errorMessage);
+        configureProducerTypeLevelMetaData(configurator, producerComponentImpl, producesMethod, producerMethodElement, memberLevelMetaData,
+                                           memberLevelElement, component,
+                                           errorMessage);
 
         return producerComponentImpl;
     }
@@ -565,20 +612,22 @@ public final class XMLDefinitionUtil
      * Configures and returns the newly created producer method webbeans
      * component.
      *
-     * @param parentComponent producer method webbeans parent component
-     * @param producesMethod producer method
+     * @param parentComponent    producer method webbeans parent component
+     * @param producesMethod     producer method
      * @param injectedParameters injected parameters of the producer method
-     * @param type java class type of the producer method return type, null if
-     *            the return type is defined as an Array element.
-     * @param arrayElement if the return type is array type, this parameter is
-     *            the Array element definition
-     * @param typeElement if the return type is a Java type, this parameter is
-     *            the Java type element
-     * @param errorMessage error message
+     * @param type               java class type of the producer method return type, null if
+     *                           the return type is defined as an Array element.
+     * @param arrayElement       if the return type is array type, this parameter is
+     *                           the Array element definition
+     * @param typeElement        if the return type is a Java type, this parameter is
+     *                           the Java type element
+     * @param errorMessage       error message
      * @return new xml defines producer method component
      * @see XMLProducerBean
      */
-    private static <T> XMLProducerBean<T> configureProducerMethod(InjectionTargetBean<?> parentComponent, Method producesMethod, List<XMLInjectionPointModel> injectedParameters, Class<T> type, Element arrayElement, Element typeElement, String errorMessage)
+    private static <T> XMLProducerBean<T> configureProducerMethod(InjectionTargetBean<?> parentComponent, Method producesMethod,
+                                                                  List<XMLInjectionPointModel> injectedParameters, Class<T> type,
+                                                                  Element arrayElement, Element typeElement, String errorMessage)
     {
         /* New producer webbeans component */
         XMLProducerBean<T> producerComponentImpl = new XMLProducerBean<T>(parentComponent, type);
@@ -624,23 +673,30 @@ public final class XMLDefinitionUtil
      * Configures xml defined producer method webbeans type level metadatas.
      *
      * @param producerComponentImpl xml webbeans producer component
-     * @param producesMethod producer method
+     * @param producesMethod        producer method
      * @param producerMethodElement producer method xml element
-     * @param memberLevelMetaData member level annotations
-     * @param memberLevelElement member level xml elements
-     * @param component parent component that defines producer method
-     * @param errorMessage error message
+     * @param memberLevelMetaData   member level annotations
+     * @param memberLevelElement    member level xml elements
+     * @param component             parent component that defines producer method
+     * @param errorMessage          error message
      * @return type level metadata configured webbeans
      * @see XMLProducerBean
      */
-    private static <T> XMLProducerBean<T> configureProducerTypeLevelMetaData(WebBeansXMLConfigurator configurator, XMLProducerBean<T> producerComponentImpl, Method producesMethod, Element producerMethodElement, List<Class<? extends Annotation>> memberLevelMetaData, List<Element> memberLevelElement, XMLManagedBean<T> component, String errorMessage)
+    private static <T> XMLProducerBean<T> configureProducerTypeLevelMetaData(WebBeansXMLConfigurator configurator, XMLProducerBean<T> producerComponentImpl,
+                                                                             Method producesMethod, Element producerMethodElement,
+                                                                             List<Class<? extends Annotation>> memberLevelMetaData,
+                                                                             List<Element> memberLevelElement, XMLManagedBean<T> component, String errorMessage)
     {
 
         for (Class<? extends Annotation> memberLevelMetaDataClass : memberLevelMetaData)
         {
-            if (!memberLevelMetaDataClass.isAnnotationPresent(NormalScope.class) && !AnnotationUtil.isStereoTypeAnnotation(memberLevelMetaDataClass) && !memberLevelMetaDataClass.equals(Named.class))
+            if (!memberLevelMetaDataClass.isAnnotationPresent(NormalScope.class) && !AnnotationUtil.isStereoTypeAnnotation(memberLevelMetaDataClass) &&
+                !memberLevelMetaDataClass.equals(Named.class))
             {
-                throw new WebBeansConfigurationException(errorMessage + "Defined annotations for producer method name : " + producesMethod.getName() + " in class : " + component.getReturnType().getName() + " is not correct");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "Defined annotations for producer method name : " + producesMethod.getName() + " in class : "
+                        + component.getReturnType().getName() +
+                        " is not correct");
             }
         }
 
@@ -653,14 +709,14 @@ public final class XMLDefinitionUtil
      * Configures the disposal method of the webbeans component using the xml
      * configuration.
      *
-     * @param component producer method webbeans component
-     * @param disposalMethod disposal method defined in the xml
+     * @param component             producer method webbeans component
+     * @param disposalMethod        disposal method defined in the xml
      * @param disposalMethodElement disposal method xml element
-     * @param errorMessage error message used in exceptions
+     * @param errorMessage          error message used in exceptions
      * @throws WebBeansConfigurationException if more than one Disposal element
-     *             exist for the given disposal method element
+     *                                        exist for the given disposal method element
      * @throws UnsatisfiedResolutionException if no producer method found for
-     *             given disposal method
+     *                                        given disposal method
      */
     public static <T> void defineXMLDisposalMethod(XMLManagedBean<T> component, Method disposalMethod, Element disposalMethodElement, String errorMessage)
     {
@@ -674,13 +730,17 @@ public final class XMLDefinitionUtil
         XMLProducerBean<?> producerComponent = null;
 
         /* Disposal method element childs */
-        Node node; Element childElement;
+        Node node;
+        Element childElement;
         NodeList ns = disposalMethodElement.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            childElement = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            childElement = (Element) node;
             if (XMLUtil.isElementInWebBeansNameSpaceWithName(childElement, WebBeansConstants.WEB_BEANS_XML_DISPOSES_ELEMENT))
             {
                 if (disposalDefined == false)
@@ -689,7 +749,8 @@ public final class XMLDefinitionUtil
                 }
                 else
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "More than one <Disposal> element is defined for defining disposal method : " + disposalMethod.getName());
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "More than one <Disposal> element is defined for defining disposal method : " + disposalMethod.getName());
                 }
 
                 //TODO: verify the first node is element.
@@ -710,7 +771,8 @@ public final class XMLDefinitionUtil
 
                 if (producerComponent == null)
                 {
-                    throw new UnsatisfiedResolutionException(errorMessage + "Producer method component of the disposal method : " + disposalMethod.getName() + "is not found");
+                    throw new UnsatisfiedResolutionException(errorMessage + "Producer method component of the disposal method : "
+                                                             + disposalMethod.getName() + "is not found");
                 }
 
                 producerComponent.setDisposalMethod(disposalMethod);
@@ -732,7 +794,7 @@ public final class XMLDefinitionUtil
     }
 
     /**
-     * TODO review the logic of this function. It is a bit unintuitive why the childElement loop exists 
+     * TODO review the logic of this function. It is a bit unintuitive why the childElement loop exists
      */
     public static <T, K> void defineXMLObservesMethod(XMLManagedBean<T> component, Method observesMethod, Element observesMethodElement, String errorMessage)
     {
@@ -747,14 +809,18 @@ public final class XMLDefinitionUtil
         Class<K> eventType = null;
 
         /* Observes method element childs */
-        Node node; Element childElement;
+        Node node;
+        Element childElement;
         NodeList ns = observesMethodElement.getChildNodes();
 
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            childElement = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            childElement = (Element) node;
             if (XMLUtil.isElementInWebBeansNameSpaceWithName(childElement, WebBeansConstants.WEB_BEANS_XML_OBSERVES_ELEMENT))
             {
                 //TODO: verify the first node is Element.
@@ -773,7 +839,7 @@ public final class XMLDefinitionUtil
                 bindingAnns = bindingTypes.toArray(bindingAnns);
 
                 beanObserver = new BeanObserverXMLImpl<K>(component, observesMethod, false,
-                        bindingAnns, null /** TODO Type! */);
+                                                          bindingAnns, null /** TODO Type! */);
 
                 beanObserver.addXMLInjectionObservesParameter(model);
 
@@ -800,11 +866,11 @@ public final class XMLDefinitionUtil
 
     public static InjectionPoint getXMLMethodInjectionPoint(AbstractOwbBean<?> component, XMLInjectionPointModel model, Method method)
     {
-        Asserts.assertNotNull(model,"model parameter can not be null");
-        Asserts.assertNotNull(method,"method parameter can not be null");
+        Asserts.assertNotNull(model, "model parameter can not be null");
+        Asserts.assertNotNull(method, "method parameter can not be null");
 
         Annotation[] annots = method.getAnnotations();
-        for(Annotation annotation : annots)
+        for (Annotation annotation : annots)
         {
             model.addAnnotation(annotation);
         }

Modified: openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java
URL: http://svn.apache.org/viewvc/openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java?rev=952910&r1=952909&r2=952910&view=diff
==============================================================================
--- openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java (original)
+++ openwebbeans/trunk/webbeans-impl/src/main/java/org/apache/webbeans/xml/XMLUtil.java Wed Jun  9 06:32:08 2010
@@ -57,7 +57,8 @@ import org.w3c.dom.NodeList;
 
 
 @SuppressWarnings("unchecked")
-public class XMLUtil {
+public class XMLUtil
+{
 
     private XMLUtil()
     {
@@ -74,12 +75,18 @@ public class XMLUtil {
         }
         Node node;
         NodeList ns = element.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            ret = verifyNameSpace((Element)node);
-            if (!ret) return false;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            ret = verifyNameSpace((Element) node);
+            if (!ret)
+            {
+                return false;
+            }
         }
         return true;
     }
@@ -94,19 +101,22 @@ public class XMLUtil {
         {
             WebBeansNameSpaceContainer.getInstance().
                     addNewPackageNameSpace(root.getNamespaceURI());
-        } else {
+        }
+        else
+        {
             String attr = root.getAttribute("xmlns");
-            if (attr != null) {
+            if (attr != null)
+            {
                 WebBeansNameSpaceContainer.getInstance().
                         addNewPackageNameSpace(root.getNamespaceURI());
             }
         }
         NamedNodeMap attrs = root.getAttributes();
-        for(int i=0; i<attrs.getLength(); i++)
+        for (int i = 0; i < attrs.getLength(); i++)
         {
             // hack the code here, since I did'nt find NameSpace support
             // in Java DOM.
-            Attr attr = (Attr)attrs.item(i);
+            Attr attr = (Attr) attrs.item(i);
             if (attr.getName().toLowerCase().startsWith("xmlns"))
             {
                 WebBeansNameSpaceContainer.getInstance().addNewPackageNameSpace(attr.getValue());
@@ -134,7 +144,8 @@ public class XMLUtil {
             Element root = doc.getDocumentElement();
             updateNameSpacePackageMapping(root);
             return root;
-        } catch (Exception e)
+        }
+        catch (Exception e)
         {
             log.fatal(OWBLogConst.FATAL_0002, e);
             throw new WebBeansException(log.getTokenString(OWBLogConst.EXCEPT_0013), e);
@@ -165,7 +176,8 @@ public class XMLUtil {
 
             Element root = documentBuilder.parse(stream).getDocumentElement();
             return root;
-        } catch (Exception e)
+        }
+        catch (Exception e)
         {
             log.fatal(OWBLogConst.FATAL_0002, e);
             throw new WebBeansException(log.getTokenString(OWBLogConst.EXCEPT_0013), e);
@@ -221,11 +233,11 @@ public class XMLUtil {
         nullCheckForElement(element);
 
         if (!isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_DEPLOY_ELEMENT) &&
-                !isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_INTERCEPTORS_ELEMENT) &&
-                !isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_DECORATORS_ELEMENT) &&
-                !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_BINDING_TYPE) &&
-                !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_INTERCEPTOR_BINDING_TYPE) &&
-                !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_STEREOTYPE))
+            !isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_INTERCEPTORS_ELEMENT) &&
+            !isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_DECORATORS_ELEMENT) &&
+            !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_BINDING_TYPE) &&
+            !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_INTERCEPTOR_BINDING_TYPE) &&
+            !hasChildElement(element, WebBeansConstants.WEB_BEANS_XML_STEREOTYPE))
         {
             return true;
         }
@@ -346,7 +358,7 @@ public class XMLUtil {
         if (isElementWebBeanDeclaration(element))
         {
             if (isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_QUEUE_ELEMENT)
-                    || isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_TOPIC_ELEMENT))
+                || isElementInWebBeansNameSpaceWithName(element, WebBeansConstants.WEB_BEANS_XML_TOPIC_ELEMENT))
             {
                 return true;
             }
@@ -376,14 +388,23 @@ public class XMLUtil {
     {
         nullCheckForElement(element);
 
-        Node node; Element child;
+        Node node;
+        Element child;
         NodeList ns = element.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            child = (Element)node;
-            if (!isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_INITIALIZER_ELEMENT) && !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DESTRUCTOR_ELEMENT) && !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_PRODUCES_ELEMENT) && !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DISPOSES_ELEMENT) && !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_OBSERVES_ELEMENT) && !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DECORATES_ELEMENT))
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            child = (Element) node;
+            if (!isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_INITIALIZER_ELEMENT) &&
+                !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DESTRUCTOR_ELEMENT) &&
+                !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_PRODUCES_ELEMENT) &&
+                !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DISPOSES_ELEMENT) &&
+                !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_OBSERVES_ELEMENT) &&
+                !isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DECORATES_ELEMENT))
             {
 
                 Class<?> clazz = getElementJavaType(child);
@@ -422,14 +443,22 @@ public class XMLUtil {
     {
         nullCheckForElement(element);
 
-        Node node; Element child;
+        Node node;
+        Element child;
         NodeList ns = element.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            child = (Element)node;
-            if (isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_INITIALIZER_ELEMENT) || isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DESTRUCTOR_ELEMENT) || isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_PRODUCES_ELEMENT) || isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DISPOSES_ELEMENT) || isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_OBSERVES_ELEMENT))
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            child = (Element) node;
+            if (isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_INITIALIZER_ELEMENT) ||
+                isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DESTRUCTOR_ELEMENT) ||
+                isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_PRODUCES_ELEMENT) ||
+                isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_DISPOSES_ELEMENT) ||
+                isElementInWebBeansNameSpaceWithName(child, WebBeansConstants.WEB_BEANS_XML_OBSERVES_ELEMENT))
             {
                 return true;
 
@@ -470,18 +499,18 @@ public class XMLUtil {
 
         Class<?> clazz = null;
         Class<?> foundClazz = null;
-        if(packageNames != null)
+        if (packageNames != null)
         {
             boolean found = false;
 
-            for(String packageName : packageNames)
+            for (String packageName : packageNames)
             {
                 String className = packageName + XMLUtil.getName(element);
                 clazz = ClassUtil.getClassFromName(className);
 
-                if(clazz != null)
+                if (clazz != null)
                 {
-                    if(found)
+                    if (found)
                     {
                         throw new DefinitionException(log.getTokenString(OWBLogConst.EXCEPT_0014) + clazz.getName());
                     }
@@ -502,7 +531,7 @@ public class XMLUtil {
     {
         Class<?> clazz = getElementJavaType(element);
 
-        if(clazz != null)
+        if (clazz != null)
         {
             return clazz.getName();
         }
@@ -517,16 +546,20 @@ public class XMLUtil {
 
 
     public static boolean hasChildElement(Element parent, String childName)
-    {Node node;
+    {
+        Node node;
         Asserts.assertNotNull(parent, "parent parameter can not be null");
         Asserts.assertNotNull(childName, "childName parameter can not be null");
         NodeList nl = parent.getChildNodes();
-        for(int i=0; i<nl.getLength(); i++)
+        for (int i = 0; i < nl.getLength(); i++)
         {
             node = nl.item(i);
             if (node instanceof Element)
             {
-                if (node.getNodeName().equals(childName)) return true;
+                if (node.getNodeName().equals(childName))
+                {
+                    return true;
+                }
             }
         }
         return false;
@@ -535,7 +568,7 @@ public class XMLUtil {
     /**
      * Return child element within webbeans namespace with given child name.
      *
-     * @param parent parent element
+     * @param parent    parent element
      * @param childName child element name
      * @return if child element exist within webbeans namespace with given child
      *         name
@@ -547,14 +580,14 @@ public class XMLUtil {
         Node node;
         Element child = null;
         NodeList nl = parent.getChildNodes();
-        for(int i=0; i<nl.getLength(); i++)
+        for (int i = 0; i < nl.getLength(); i++)
         {
             node = nl.item(i);
             if (node instanceof Element)
             {
                 if (node.getNodeName().equals(childName))
                 {
-                    child = (Element)node;
+                    child = (Element) node;
                 }
             }
         }
@@ -572,7 +605,7 @@ public class XMLUtil {
     /**
      * Creates new xml injection point model.
      *
-     * @param typeElement injection point API type
+     * @param typeElement  injection point API type
      * @param errorMessage error message
      * @return new injection point model object
      */
@@ -596,7 +629,7 @@ public class XMLUtil {
     /**
      * Injection point with Java type.
      *
-     * @param typeElement injection point API type
+     * @param typeElement  injection point API type
      * @param errorMessage error message
      * @return new injection point model
      */
@@ -607,12 +640,14 @@ public class XMLUtil {
         Class<?> clazz = getElementJavaType(typeElement);
         if (clazz == null)
         {
-            throw new NonexistentTypeException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
+            throw new NonexistentTypeException(
+                    errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
         }
 
         else if (clazz.isAnnotation() || clazz.isArray() || clazz.isEnum())
         {
-            throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
+            throw new WebBeansConfigurationException(
+                    errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
         }
 
         else
@@ -623,28 +658,35 @@ public class XMLUtil {
             List<Annotation> bindingAnnots = new ArrayList<Annotation>();
 
             Class<? extends Annotation> definedBindingType = null;
-            Node node; Element childElement;
+            Node node;
+            Element childElement;
             NodeList ns = typeElement.getChildNodes();
-            for(int i=0; i<ns.getLength(); i++)
+            for (int i = 0; i < ns.getLength(); i++)
             {
                 node = ns.item(i);
-                if (!(node instanceof Element)) continue;
-                childElement = (Element)node;
+                if (!(node instanceof Element))
+                {
+                    continue;
+                }
+                childElement = (Element) node;
                 Type actualType = getElementJavaType(childElement);
                 if (actualType == null)
                 {
-                    throw new NonexistentTypeException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
+                    throw new NonexistentTypeException(
+                            errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not found in the deployment");
                 }
                 else if (((Class) actualType).isArray() || ((Class) actualType).isEnum())
                 {
-                    throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " must be class or interface type");
                 }
                 else if (((Class) actualType).isAnnotation())
                 {
                     Class<? extends Annotation> annotClazz = (Class<? extends Annotation>) actualType;
                     if (!AnnotationUtil.isQualifierAnnotation(annotClazz))
                     {
-                        throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not a @Qualifier");
+                        throw new WebBeansConfigurationException(
+                                errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is not a @Qualifier");
                     }
 
                     if (definedBindingType == null)
@@ -655,7 +697,8 @@ public class XMLUtil {
                     {
                         if (definedBindingType.equals(annotClazz))
                         {
-                            throw new IllegalArgumentException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is duplicated");
+                            throw new IllegalArgumentException(
+                                    errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " is duplicated");
                         }
                     }
 
@@ -669,7 +712,8 @@ public class XMLUtil {
 
             if (actualTypeArgument != typeArguments.size())
             {
-                throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " actual type parameters size are not equals defined in the xml");
+                throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) +
+                                                         " actual type parameters size are not equals defined in the xml");
             }
 
             int i = 0;
@@ -682,7 +726,8 @@ public class XMLUtil {
 
                 if (!clazzBound.isAssignableFrom((Class<?>) type))
                 {
-                    throw new WebBeansConfigurationException(errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " actual type parameter bounded exception");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + log.getTokenString(OWBLogConst.TEXT_JAVA_TYPENAME) + getElementJavaClassName(typeElement) + " actual type parameter bounded exception");
                 }
 
             }
@@ -710,8 +755,8 @@ public class XMLUtil {
      * Creates new annotation with configured members values.
      *
      * @param annotationElement annotation element
-     * @param annotClazz annotation class
-     * @param errorMessage error message
+     * @param annotClazz        annotation class
+     * @param errorMessage      error message
      * @return new annotation with members configures
      */
     public static Annotation getXMLDefinedAnnotationMember(Element annotationElement, Class<? extends Annotation> annotClazz, String errorMessage)
@@ -720,9 +765,9 @@ public class XMLUtil {
         NamedNodeMap attrs = annotationElement.getAttributes();
         List<String> attrsNames = new ArrayList<String>();
 
-        for(int i=0; i<attrs.getLength(); i++)
+        for (int i = 0; i < attrs.getLength(); i++)
         {
-            Attr attr = (Attr)attrs.item(i);
+            Attr attr = (Attr) attrs.item(i);
             attrsNames.add(attr.getName());
         }
 
@@ -731,7 +776,8 @@ public class XMLUtil {
         {
             if (attrsNames.contains("value"))
             {
-                throw new WebBeansConfigurationException(errorMessage + "Annotation with type : " + annotClazz.getName() + " can not have both element 'value' attribute and body text");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "Annotation with type : " + annotClazz.getName() + " can not have both element 'value' attribute and body text");
             }
         }
         /* Check for attribute "value" */
@@ -742,7 +788,7 @@ public class XMLUtil {
                 try
                 {
                     /* Contains value member method */
-                    SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, "value", new Class[] {});
+                    SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, "value", new Class[]{});
 
                 }
                 catch (SecurityException e)
@@ -762,7 +808,7 @@ public class XMLUtil {
         {
             try
             {
-                SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, attrName, new Class[] {});
+                SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, attrName, new Class[]{});
             }
             catch (SecurityException e)
             {
@@ -783,7 +829,9 @@ public class XMLUtil {
             {
                 if (!attrsNames.contains(member.getName()))
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "Annotation with type : " + annotClazz.getName() + " with non-default member method with name : " + member.getName() + " has to defined in the xml element attribute.");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "Annotation with type : " + annotClazz.getName() + " with non-default member method with name : " + member.getName() +
+                            " has to defined in the xml element attribute.");
                 }
             }
         }
@@ -794,8 +842,8 @@ public class XMLUtil {
     /**
      * Creates new annotation with its member values.
      *
-     * @param attrs list of annotation element attributes
-     * @param annotClazz annotation class
+     * @param attrs        list of annotation element attributes
+     * @param annotClazz   annotation class
      * @param errorMessage error message
      * @return new annotation
      */
@@ -803,9 +851,9 @@ public class XMLUtil {
     {
         WebBeansAnnotation annotation = JavassistProxyFactory.createNewAnnotationProxy(annotClazz);
         boolean isValueAttrDefined = false;
-        for(int i=0; i<attrs.getLength(); i++)
+        for (int i = 0; i < attrs.getLength(); i++)
         {
-            Attr attr = (Attr)attrs.item(i);
+            Attr attr = (Attr) attrs.item(i);
             String attrName = attr.getName();
             String attrValue = attr.getValue();
 
@@ -820,7 +868,7 @@ public class XMLUtil {
             Class returnType = null;
             try
             {
-                returnType = SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, attrName, new Class[] {}).getReturnType();
+                returnType = SecurityUtil.doPrivilegedGetDeclaredMethod(annotClazz, attrName, new Class[]{}).getReturnType();
                 Object value = null;
                 if (returnType.isPrimitive())
                 {
@@ -841,12 +889,14 @@ public class XMLUtil {
                 }
                 else
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "Annotation with type : " + annotClazz.getName() + " with member : " + attrName + " does not have sutiable member return type");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "Annotation with type : " + annotClazz.getName() + " with member : " + attrName + " does not have sutiable member return type");
                 }
 
                 if (value == null)
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "Annotation with type : " + annotClazz.getName() + " with member : " + attrName + " value does not defined correctly");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "Annotation with type : " + annotClazz.getName() + " with member : " + attrName + " value does not defined correctly");
                 }
 
                 annotation.setMemberValue(attrName, value);
@@ -878,7 +928,7 @@ public class XMLUtil {
     /**
      * Injection point with array type.
      *
-     * @param typeElement array element
+     * @param typeElement  array element
      * @param errorMessage error message
      * @return new injection point model
      */
@@ -888,14 +938,18 @@ public class XMLUtil {
 
         boolean isElementTypeDefined = false;
         Set<Annotation> anns = new HashSet<Annotation>();
-        Node node; Element childElement;
+        Node node;
+        Element childElement;
         NodeList ns = typeElement.getChildNodes();
 
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            childElement = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            childElement = (Element) node;
             Class<?> clazz = XMLUtil.getElementJavaType(childElement);
 
             if (clazz == null)
@@ -909,13 +963,15 @@ public class XMLUtil {
             }
             else if (clazz.isArray() || clazz.isEnum())
             {
-                throw new WebBeansConfigurationException(errorMessage + "<Array> element child with Java type : " + getElementJavaClassName(typeElement) + " must be class or interface type");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "<Array> element child with Java type : " + getElementJavaClassName(typeElement) + " must be class or interface type");
             }
             else
             {
                 if (isElementTypeDefined)
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "<Array> element can not have more than one child element. It has one child element that declares its type");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "<Array> element can not have more than one child element. It has one child element that declares its type");
                 }
                 else
                 {
@@ -942,13 +998,17 @@ public class XMLUtil {
     {
         boolean isElementTypeDefined = false;
         Set<Annotation> anns = new HashSet<Annotation>();
-        Node node; Element childElement;
+        Node node;
+        Element childElement;
         NodeList ns = typeElement.getChildNodes();
-        for(int i=0; i<ns.getLength(); i++)
+        for (int i = 0; i < ns.getLength(); i++)
         {
             node = ns.item(i);
-            if (!(node instanceof Element)) continue;
-            childElement = (Element)node;
+            if (!(node instanceof Element))
+            {
+                continue;
+            }
+            childElement = (Element) node;
             Class<?> clazz = XMLUtil.getElementJavaType(childElement);
 
             if (clazz == null)
@@ -962,13 +1022,15 @@ public class XMLUtil {
             }
             else if (clazz.isArray() || clazz.isEnum())
             {
-                throw new WebBeansConfigurationException(errorMessage + "<Array> element child with Java type : " + getElementJavaClassName(typeElement) + " must be class or interface type");
+                throw new WebBeansConfigurationException(
+                        errorMessage + "<Array> element child with Java type : " + getElementJavaClassName(typeElement) + " must be class or interface type");
             }
             else
             {
                 if (isElementTypeDefined)
                 {
-                    throw new WebBeansConfigurationException(errorMessage + "<Array> element can not have more than one child element. It has one child element that declares its type");
+                    throw new WebBeansConfigurationException(
+                            errorMessage + "<Array> element can not have more than one child element. It has one child element that declares its type");
                 }
                 else
                 {



Mime
View raw message