org.apache.webbeans.xml
Class XMLUtil

java.lang.Object
  extended by org.apache.webbeans.xml.XMLUtil

public class XMLUtil
extends Object


Method Summary
static
<T> void
defineXMLProducerApiTypeFromArrayElement(XMLProducerBean<T> component, Element typeElement, String errorMessage)
           
static XMLInjectionPointModel getArrayInjectionPointModel(Element typeElement, String errorMessage)
          Injection point with array type.
static String getElementJavaClassName(Element element)
           
static Class<?> getElementJavaType(Element element)
           
static String getElementNameSpace(Element element)
           
static XMLInjectionPointModel getInjectionPointModel(Element typeElement, String errorMessage)
          Creates new xml injection point model.
static String getName(Element element)
           
static Element getRootElement(InputStream stream)
           
static Element getSpecStrictRootElement(InputStream stream)
          Gets the root element of the parsed document.
static Annotation getXMLDefinedAnnotationMember(Element annotationElement, Class<? extends Annotation> annotClazz, String errorMessage)
          Creates new annotation with configured members values.
static boolean hasChildElement(Element parent, String childName)
           
static boolean hasChildElementWithWebBeansNameSpace(Element parent, String childName)
          Return child element within webbeans namespace with given child name.
static boolean isElementBindingTypeDecleration(Element element)
          Returns true if element has a bindingtype child element in webbeans namespace false otherwise.
static boolean isElementDecoratosDeclaration(Element element)
           
static boolean isElementDeployDeclaration(Element element)
           
static boolean isElementField(Element element)
          Returns true if this element defines field, false otherwise.
static boolean isElementHasDecoratesChild(Element element)
           
static boolean isElementInNamespace(Element element, String namespace)
           
static boolean isElementInterceptorBindingTypeDecleration(Element element)
          Returns true if element has a interceptor bindingtype child element in webbeans namespace false otherwise.
static boolean isElementInterceptorsDeclaration(Element element)
           
static boolean isElementInWebBeansNameSpace(Element element)
           
static boolean isElementInWebBeansNameSpaceWithName(Element element, String name)
           
static boolean isElementJMSDeclaration(Element element)
          Returns true if this element defines JMS webbeans, false otherwise.
static boolean isElementMethod(Element element)
          Checks that given element is a webbeans method or not.
static boolean isElementStereoTypeDecleration(Element element)
          Returns true if element has a stereotype child element in webbeans namespace false otherwise.
static boolean isElementWebBeanDeclaration(Element element)
           
protected static void updateNameSpacePackageMapping(Element root)
           
protected static boolean verifyNameSpace(Element element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

verifyNameSpace

protected static boolean verifyNameSpace(Element element)

updateNameSpacePackageMapping

protected static void updateNameSpacePackageMapping(Element root)

getRootElement

public static Element getRootElement(InputStream stream)
                              throws WebBeansException
Throws:
WebBeansException

getSpecStrictRootElement

public static Element getSpecStrictRootElement(InputStream stream)
                                        throws WebBeansException
Gets the root element of the parsed document.

Parameters:
stream - parsed document
Returns:
root element of the document
Throws:
WebBeansException - if any runtime exception occurs

isElementInNamespace

public static boolean isElementInNamespace(Element element,
                                           String namespace)

isElementInWebBeansNameSpace

public static boolean isElementInWebBeansNameSpace(Element element)

isElementInWebBeansNameSpaceWithName

public static boolean isElementInWebBeansNameSpaceWithName(Element element,
                                                           String name)

getElementNameSpace

public static String getElementNameSpace(Element element)

isElementWebBeanDeclaration

public static boolean isElementWebBeanDeclaration(Element element)

isElementBindingTypeDecleration

public static boolean isElementBindingTypeDecleration(Element element)
Returns true if element has a bindingtype child element in webbeans namespace false otherwise.

Parameters:
element - parent element
Returns:
true if element has a bindingtype child element in webbeans namespace

isElementInterceptorBindingTypeDecleration

public static boolean isElementInterceptorBindingTypeDecleration(Element element)
Returns true if element has a interceptor bindingtype child element in webbeans namespace false otherwise.

Parameters:
element - parent element
Returns:
true if element has a interceptor bindingtype child element in webbeans namespace

isElementStereoTypeDecleration

public static boolean isElementStereoTypeDecleration(Element element)
Returns true if element has a stereotype child element in webbeans namespace false otherwise.

Parameters:
element - parent element
Returns:
true if element has a stereotype child element in webbeans namespace

isElementDeployDeclaration

public static boolean isElementDeployDeclaration(Element element)

isElementInterceptorsDeclaration

public static boolean isElementInterceptorsDeclaration(Element element)

isElementDecoratosDeclaration

public static boolean isElementDecoratosDeclaration(Element element)

isElementJMSDeclaration

public static boolean isElementJMSDeclaration(Element element)
Returns true if this element defines JMS webbeans, false otherwise.

Parameters:
element - webbeans element decleration
Returns:
true if this element defines JMS webbeans, false otherwise

isElementHasDecoratesChild

public static boolean isElementHasDecoratesChild(Element element)

isElementField

public static boolean isElementField(Element element)
Returns true if this element defines field, false otherwise.

Parameters:
element - webbeans decleration child element
Returns:
true if this element defines field, false otherwise

isElementMethod

public static boolean isElementMethod(Element element)
Checks that given element is a webbeans method or not.

Parameters:
element - dom element represents method decleration
Returns:
true if the given element is a true element decleration false otherwise

getName

public static String getName(Element element)

getElementJavaType

public static Class<?> getElementJavaType(Element element)

getElementJavaClassName

public static String getElementJavaClassName(Element element)

hasChildElement

public static boolean hasChildElement(Element parent,
                                      String childName)

hasChildElementWithWebBeansNameSpace

public static boolean hasChildElementWithWebBeansNameSpace(Element parent,
                                                           String childName)
Return child element within webbeans namespace with given child name.

Parameters:
parent - parent element
childName - child element name
Returns:
if child element exist within webbeans namespace with given child name

getInjectionPointModel

public static XMLInjectionPointModel getInjectionPointModel(Element typeElement,
                                                            String errorMessage)
Creates new xml injection point model.

Parameters:
typeElement - injection point API type
errorMessage - error message
Returns:
new injection point model object

getXMLDefinedAnnotationMember

public static Annotation getXMLDefinedAnnotationMember(Element annotationElement,
                                                       Class<? extends Annotation> annotClazz,
                                                       String errorMessage)
Creates new annotation with configured members values.

Parameters:
annotationElement - annotation element
annotClazz - annotation class
errorMessage - error message
Returns:
new annotation with members configures

getArrayInjectionPointModel

public static XMLInjectionPointModel getArrayInjectionPointModel(Element typeElement,
                                                                 String errorMessage)
Injection point with array type.

Parameters:
typeElement - array element
errorMessage - error message
Returns:
new injection point model

defineXMLProducerApiTypeFromArrayElement

public static <T> void defineXMLProducerApiTypeFromArrayElement(XMLProducerBean<T> component,
                                                                Element typeElement,
                                                                String errorMessage)


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.