org.jboss.metadata
Class MetaData

java.lang.Object
  extended byorg.jboss.metadata.MetaData
All Implemented Interfaces:
java.lang.Cloneable, XmlLoadable (src)
Direct Known Subclasses:
ActivationConfigPropertyMetaData (src) , ApplicationMetaData (src) , AssemblyDescriptorMetaData (src) , BeanMetaData (src) , CacheInvalidationConfigMetaData (src) , ClusterConfigMetaData (src) , ConfigurationMetaData (src) , EjbLocalRefMetaData (src) , EjbRefMetaData (src) , EnvEntryMetaData (src) , InvokerProxyBindingMetaData (src) , J2eeApplicationMetaData (src) , J2eeModuleMetaData (src) , MessageDestinationMetaData (src) , MessageDestinationRefMetaData (src) , MethodMetaData (src) , QueryMetaData (src) , RelationMetaData (src) , RelationshipRoleMetaData (src) , ResourceEnvRefMetaData (src) , ResourceRefMetaData (src) , SecurityIdentityMetaData (src) , SecurityRoleMetaData (src) , SecurityRoleRefMetaData (src) , WebMetaData (src)

public abstract class MetaData
extends java.lang.Object
implements java.lang.Cloneable, XmlLoadable (src)

An abstract base class for metadata containers.


Field Summary
protected static Logger (src) log
           
static byte TX_MANDATORY
           
static byte TX_NEVER
           
static byte TX_NOT_SUPPORTED
           
static byte TX_REQUIRED
           
static byte TX_REQUIRES_NEW
           
static byte TX_SUPPORTS
           
static byte TX_UNKNOWN
           
 
Constructor Summary
MetaData()
           
 
Method Summary
 java.lang.Object clone()
          Create a field wise copy of the object.
static java.util.Iterator getChildrenByTagName(org.w3c.dom.Element element, java.lang.String tagName)
          Returns an iterator over the children of the given element with the given tag name.
static java.lang.String getElementAttribute(org.w3c.dom.Element element, java.lang.String attrName)
          Get an attribute value of the given element.
static java.lang.String getElementContent(org.w3c.dom.Element element)
          Get the content of the given element.
static java.lang.String getElementContent(org.w3c.dom.Element element, java.lang.String defaultStr)
          Get the content of the given element.
static java.lang.String getFirstElementContent(org.w3c.dom.Element element, java.lang.String defaultStr)
           
static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element, java.lang.String tagName)
          Gets the child of the specified element having the specified name.
static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element, java.lang.String tagName, org.w3c.dom.Element defaultElement)
          Gets the child of the specified element having the specified name.
static boolean getOptionalChildBooleanContent(org.w3c.dom.Element element, java.lang.String name)
           
static boolean getOptionalChildBooleanContent(org.w3c.dom.Element element, java.lang.String name, boolean defaultValue)
           
static java.lang.String getOptionalChildContent(org.w3c.dom.Element element, java.lang.String tagName)
          Macro to get the content of an optional child element.
static java.lang.String getOptionalChildContent(org.w3c.dom.Element element, java.lang.String tagName, java.lang.String defaultValue)
          Macro to get the content of an optional child element with default value.
static org.w3c.dom.Element getUniqueChild(org.w3c.dom.Element element, java.lang.String tagName)
          Gets the child of the specified element having the specified unique name.
static java.lang.String getUniqueChildContent(org.w3c.dom.Element element, java.lang.String tagName)
          Macro to get the content of a unique child element.
 void importEjbJarXml(org.w3c.dom.Element element)
          Non-operation.
 void importJbossXml(org.w3c.dom.Element element)
          Non-operation.
 void importXml(org.w3c.dom.Element element)
          Imports either the jboss or ejb-jar from the given element.
protected  boolean jdk13Enabled()
          Check if we are running in a JDK v1.3 virtual machine or better.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger (src)  log

TX_NOT_SUPPORTED

public static final byte TX_NOT_SUPPORTED
See Also:
Constant Field Values (src)

TX_REQUIRED

public static final byte TX_REQUIRED
See Also:
Constant Field Values (src)

TX_SUPPORTS

public static final byte TX_SUPPORTS
See Also:
Constant Field Values (src)

TX_REQUIRES_NEW

public static final byte TX_REQUIRES_NEW
See Also:
Constant Field Values (src)

TX_MANDATORY

public static final byte TX_MANDATORY
See Also:
Constant Field Values (src)

TX_NEVER

public static final byte TX_NEVER
See Also:
Constant Field Values (src)

TX_UNKNOWN

public static final byte TX_UNKNOWN
See Also:
Constant Field Values (src)
Constructor Detail

MetaData

public MetaData()
Method Detail

getChildrenByTagName

public static java.util.Iterator getChildrenByTagName(org.w3c.dom.Element element,
                                                      java.lang.String tagName)
Returns an iterator over the children of the given element with the given tag name.

Parameters:
element - The parent element
tagName - The name of the desired child
Returns:
An interator of children or null if element is null.

getUniqueChild

public static org.w3c.dom.Element getUniqueChild(org.w3c.dom.Element element,
                                                 java.lang.String tagName)
                                          throws DeploymentException (src) 
Gets the child of the specified element having the specified unique name. If there are more than one children elements with the same name and exception is thrown.

Parameters:
element - The parent element
tagName - The name of the desired child
Returns:
The named child.
Throws:
DeploymentException (src) - Child was not found or was not unique.

getOptionalChild

public static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element,
                                                   java.lang.String tagName)
                                            throws DeploymentException (src) 
Gets the child of the specified element having the specified name. If the child with this name doesn't exist then null is returned instead.

Parameters:
element - the parent element
tagName - the name of the desired child
Returns:
either the named child or null
Throws:
DeploymentException (src)

getOptionalChild

public static org.w3c.dom.Element getOptionalChild(org.w3c.dom.Element element,
                                                   java.lang.String tagName,
                                                   org.w3c.dom.Element defaultElement)
                                            throws DeploymentException (src) 
Gets the child of the specified element having the specified name. If the child with this name doesn't exist then the supplied default element is returned instead.

Parameters:
element - the parent element
tagName - the name of the desired child
defaultElement - the element to return if the child doesn't exist
Returns:
either the named child or the supplied default
Throws:
DeploymentException (src)

getElementAttribute

public static java.lang.String getElementAttribute(org.w3c.dom.Element element,
                                                   java.lang.String attrName)
Get an attribute value of the given element.

Parameters:
element - The element to get the attribute value for.
Returns:
The attribute value or null.

getElementContent

public static java.lang.String getElementContent(org.w3c.dom.Element element)
Get the content of the given element.

Parameters:
element - The element to get the content for.
Returns:
The content of the element or null.

getElementContent

public static java.lang.String getElementContent(org.w3c.dom.Element element,
                                                 java.lang.String defaultStr)
Get the content of the given element.

Parameters:
element - The element to get the content for.
defaultStr - The default to return when there is no content.
Returns:
The content of the element or the default.

getFirstElementContent

public static java.lang.String getFirstElementContent(org.w3c.dom.Element element,
                                                      java.lang.String defaultStr)

getUniqueChildContent

public static java.lang.String getUniqueChildContent(org.w3c.dom.Element element,
                                                     java.lang.String tagName)
                                              throws DeploymentException (src) 
Macro to get the content of a unique child element.

Parameters:
element - The parent element.
tagName - The name of the desired child.
Returns:
The element content or null.
Throws:
DeploymentException (src)

getOptionalChildContent

public static java.lang.String getOptionalChildContent(org.w3c.dom.Element element,
                                                       java.lang.String tagName)
                                                throws DeploymentException (src) 
Macro to get the content of an optional child element.

Parameters:
element - The parent element.
tagName - The name of the desired child.
Returns:
The element content or null.
Throws:
DeploymentException (src)

getOptionalChildContent

public static java.lang.String getOptionalChildContent(org.w3c.dom.Element element,
                                                       java.lang.String tagName,
                                                       java.lang.String defaultValue)
                                                throws DeploymentException (src) 
Macro to get the content of an optional child element with default value.

Parameters:
element - The parent element.
tagName - The name of the desired child.
Returns:
The element content or null.
Throws:
DeploymentException (src)

getOptionalChildBooleanContent

public static boolean getOptionalChildBooleanContent(org.w3c.dom.Element element,
                                                     java.lang.String name)
                                              throws DeploymentException (src) 
Throws:
DeploymentException (src)

getOptionalChildBooleanContent

public static boolean getOptionalChildBooleanContent(org.w3c.dom.Element element,
                                                     java.lang.String name,
                                                     boolean defaultValue)
                                              throws DeploymentException (src) 
Throws:
DeploymentException (src)

clone

public java.lang.Object clone()
Create a field wise copy of the object.


importXml

public void importXml(org.w3c.dom.Element element)
               throws DeploymentException (src) 
Imports either the jboss or ejb-jar from the given element.

Specified by:
importXml in interface XmlLoadable (src)
Parameters:
element - The element to import.
Throws:
DeploymentException (src) - Unrecognized root tag.

importEjbJarXml

public void importEjbJarXml(org.w3c.dom.Element element)
                     throws DeploymentException (src) 
Non-operation.

Parameters:
element -
Throws:
DeploymentException (src)

importJbossXml

public void importJbossXml(org.w3c.dom.Element element)
                    throws DeploymentException (src) 
Non-operation.

Parameters:
element -
Throws:
DeploymentException (src)

jdk13Enabled

protected boolean jdk13Enabled()
Check if we are running in a JDK v1.3 virtual machine or better.

Returns:
True if the virtual machine is v1.3 or better.