org.apache.webbeans.xml
Class XMLDefinitionUtil

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

public final class XMLDefinitionUtil
extends Object


Method Summary
static void checkSimpleWebBeansInXML(Class<?> clazz, Element webBeanDecleration, String errorMessage)
          Checks the conditions for simple webbeans class defined in the XML file.
static void checkTypeMetaDataClasses(List<Class<? extends Annotation>> typeSet, String errorMessage)
           
static
<T> boolean
defineXMLBindingType(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
           
static
<T> void
defineXMLClassLevelInterceptorType(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
           
static
<T> void
defineXMLDecorators(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, Element decoratorDecleration, String errorMessage)
           
static
<T> void
defineXMLDisposalMethod(XMLManagedBean<T> component, Method disposalMethod, Element disposalMethodElement, String errorMessage)
          Configures the disposal method of the webbeans component using the xml configuration.
static
<T> void
defineXMLInterceptors(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet, List<Element> annotationElementList, String errorMessage)
           
static
<T> void
defineXMLMethodLevelInterceptorType(XMLManagedBean<T> component, Method interceptorMethod, Element interceptorMethodElement, String errorMessage)
           
static
<T> boolean
defineXMLName(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet)
           
static
<T,K> void
defineXMLObservesMethod(XMLManagedBean<T> component, Method observesMethod, Element observesMethodElement, String errorMessage)
          TODO review the logic of this function.
static
<T> XMLProducerBean<T>
defineXMLProducerMethod(WebBeansXMLConfigurator configurator, XMLManagedBean<T> component, Method producesMethod, Element producerMethodElement, String errorMessage)
          Returns newly created and configures xml webbeans producer component.
static
<T> void
defineXMLSpecializes(XMLManagedBean<T> component, List<Class<? extends Annotation>> annotationSet)
           
static
<T> void
defineXMLStereoType(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet)
          Configures the webbeans component stereotype.
static
<T> Class<? extends Annotation>
defineXMLTypeMetaData(AbstractOwbBean<T> component, List<Class<? extends Annotation>> annotationSet, Class<? extends Annotation> defineType, String errorMessage)
          Gets applicable annotation class for given defineType parameter from the given annotation set.
static InjectionPoint getXMLMethodInjectionPoint(AbstractOwbBean<?> component, XMLInjectionPointModel model, Method method)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

checkSimpleWebBeansInXML

public static void checkSimpleWebBeansInXML(Class<?> clazz,
                                            Element webBeanDecleration,
                                            String errorMessage)
                                     throws WebBeansConfigurationException
Checks the conditions for simple webbeans class defined in the XML file.

Parameters:
clazz - simple webbeans class declared in XML
Throws:
WebBeansConfigurationException - if check is fail

checkTypeMetaDataClasses

public static void checkTypeMetaDataClasses(List<Class<? extends Annotation>> typeSet,
                                            String errorMessage)

defineXMLTypeMetaData

public static <T> Class<? extends Annotation> defineXMLTypeMetaData(AbstractOwbBean<T> component,
                                                                    List<Class<? extends Annotation>> annotationSet,
                                                                    Class<? extends Annotation> defineType,
                                                                    String errorMessage)
Gets applicable annotation class for given defineType parameter from the given annotation set.

Parameters:
component - webbeans component
annotationSet - type-level metadata annotation set
defineType - annotation type class
errorMessage - error message for the operation
Returns:
applicable annotation class for given defineType parameter from the given set

defineXMLBindingType

public static <T> boolean defineXMLBindingType(AbstractOwbBean<T> component,
                                               List<Class<? extends Annotation>> annotationSet,
                                               List<Element> annotationElementList,
                                               String errorMessage)

defineXMLClassLevelInterceptorType

public static <T> void defineXMLClassLevelInterceptorType(XMLManagedBean<T> component,
                                                          List<Class<? extends Annotation>> annotationSet,
                                                          List<Element> annotationElementList,
                                                          String errorMessage)

defineXMLMethodLevelInterceptorType

public static <T> void defineXMLMethodLevelInterceptorType(XMLManagedBean<T> component,
                                                           Method interceptorMethod,
                                                           Element interceptorMethodElement,
                                                           String errorMessage)

defineXMLStereoType

public static <T> void defineXMLStereoType(AbstractOwbBean<T> component,
                                           List<Class<? extends Annotation>> annotationSet)
Configures the webbeans component stereotype.

Parameters:
component - webbeans component
annotationSet - set of type-level metadata annotation set

defineXMLName

public static <T> boolean defineXMLName(AbstractOwbBean<T> component,
                                        List<Class<? extends Annotation>> annotationSet)

defineXMLSpecializes

public static <T> void defineXMLSpecializes(XMLManagedBean<T> component,
                                            List<Class<? extends Annotation>> annotationSet)

defineXMLInterceptors

public static <T> void defineXMLInterceptors(XMLManagedBean<T> component,
                                             List<Class<? extends Annotation>> annotationSet,
                                             List<Element> annotationElementList,
                                             String errorMessage)

defineXMLDecorators

public static <T> void defineXMLDecorators(XMLManagedBean<T> component,
                                           List<Class<? extends Annotation>> annotationSet,
                                           Element decoratorDecleration,
                                           String errorMessage)

defineXMLProducerMethod

public static <T> XMLProducerBean<T> defineXMLProducerMethod(WebBeansXMLConfigurator configurator,
                                                             XMLManagedBean<T> component,
                                                             Method producesMethod,
                                                             Element producerMethodElement,
                                                             String errorMessage)
Returns newly created and configures xml webbeans producer component.

Parameters:
component - webbeans component that defines producer method
producesMethod - producer method
producerMethodElement - produce method xml element
errorMessage - error message
Returns:
newly created and configures xml webbeans producer component.
See Also:
XMLProducerBean

defineXMLDisposalMethod

public static <T> void defineXMLDisposalMethod(XMLManagedBean<T> component,
                                               Method disposalMethod,
                                               Element disposalMethodElement,
                                               String errorMessage)
Configures the disposal method of the webbeans component using the xml configuration.

Parameters:
component - producer method webbeans component
disposalMethod - disposal method defined in the xml
disposalMethodElement - disposal method xml element
errorMessage - error message used in exceptions
Throws:
WebBeansConfigurationException - if more than one Disposal element exist for the given disposal method element
UnsatisfiedResolutionException - if no producer method found for given disposal method

defineXMLObservesMethod

public static <T,K> void defineXMLObservesMethod(XMLManagedBean<T> component,
                                                 Method observesMethod,
                                                 Element observesMethodElement,
                                                 String errorMessage)
TODO review the logic of this function. It is a bit unintuitive why the childElement loop exists


getXMLMethodInjectionPoint

public static InjectionPoint getXMLMethodInjectionPoint(AbstractOwbBean<?> component,
                                                        XMLInjectionPointModel model,
                                                        Method method)


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