Class ApplicationXml
- java.lang.Object
-
- org.jdom2.Document
-
- org.codehaus.cargo.module.AbstractDescriptor
-
- org.codehaus.cargo.module.application.ApplicationXml
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Descriptor
,J2eeDescriptor
,org.jdom2.NamespaceAware
,org.jdom2.Parent
public class ApplicationXml extends AbstractDescriptor implements J2eeDescriptor
Encapsulates the DOM representation of an EAR descriptor (application.xml
) to provide convenience methods for easy access and manipulation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ApplicationXml(org.jdom2.Element rootElement, DescriptorType type)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addEjbModule(String name)
Adds a ejb module to the deployment descriptor.void
addWebModule(String uri, String context)
Adds a web module to the deployment descriptor.List<String>
getEjbModules()
Returns a list of the ejb modules defined in the descriptor.List<org.jdom2.Element>
getElements(ApplicationXmlTag tag)
Returns a list of the elements that match the specified tag.String
getFileName()
Returns the file name of this descriptor.List<Descriptor>
getVendorDescriptors()
Returns all vendor descriptors associated with this J2EE deployment descriptor.ApplicationXmlVersion
getVersion()
org.jdom2.Element
getWebModule(String webUri)
Returns the element that contains the definition of a specific web module, ornull
if a web module with the specified web-uri is not defined.String
getWebModuleContextRoot(String webUri)
Returns the context root of the the specified web module.List<String>
getWebModuleUris()
Returns a list of the URIs of the web modules defined in the descriptor.-
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptor
addElement, checkElement, containsElement, createNestedText, getChildText, getChildText, getContentExceptComments, getDescriptorType, getDocument, getElements, getElements, getImmediateChild, getInsertionPointFor, getNestedElements, getNestedText, getTagByIdentifier, getTagByIdentifier, getTags, getTags, getText, sameContent, sameElement
-
Methods inherited from class org.jdom2.Document
addContent, addContent, addContent, addContent, canContainContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced, getParent, getProperty, getRootElement, hashCode, hasRootElement, indexOf, removeContent, removeContent, removeContent, removeContent, setBaseURI, setContent, setContent, setContent, setContent, setDocType, setProperty, setRootElement, toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.codehaus.cargo.module.Descriptor
addElement, getDescriptorType, getDocument, getRootElement, getTagByIdentifier, getTagByIdentifier, getTags, getTags
-
Methods inherited from interface org.jdom2.NamespaceAware
getNamespacesInherited, getNamespacesInScope, getNamespacesIntroduced
-
Methods inherited from interface org.jdom2.Parent
addContent, addContent, addContent, addContent, canContainContent, clone, cloneContent, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getParent, indexOf, removeContent, removeContent, removeContent, removeContent
-
-
-
-
Constructor Detail
-
ApplicationXml
public ApplicationXml(org.jdom2.Element rootElement, DescriptorType type)
Constructor.- Parameters:
rootElement
- the root element for this descriptortype
- the type of this descriptor
-
-
Method Detail
-
getVersion
public ApplicationXmlVersion getVersion()
- Returns:
- The J2EE API version.
-
getWebModule
public org.jdom2.Element getWebModule(String webUri)
Returns the element that contains the definition of a specific web module, ornull
if a web module with the specified web-uri is not defined.- Parameters:
webUri
- The uri of the web module- Returns:
- The DOM element representing the web module definition
-
getWebModuleContextRoot
public String getWebModuleContextRoot(String webUri)
Returns the context root of the the specified web module.- Parameters:
webUri
- The uri of the web module- Returns:
- The context root of the web module
-
getWebModuleUris
public List<String> getWebModuleUris()
Returns a list of the URIs of the web modules defined in the descriptor.- Returns:
- A list of the URIs of the web modules
-
getEjbModules
public List<String> getEjbModules()
Returns a list of the ejb modules defined in the descriptor.- Returns:
- A list of Strings over the ejb modules
-
getElements
public List<org.jdom2.Element> getElements(ApplicationXmlTag tag)
Returns a list of the elements that match the specified tag.- Parameters:
tag
- The descriptor tag of which the elements should be returned- Returns:
- A list of the elements matching the tag, in the order they occur in the descriptor
-
addWebModule
public void addWebModule(String uri, String context)
Adds a web module to the deployment descriptor.- Parameters:
uri
- the uri of the new modulecontext
- the context of the new module
-
addEjbModule
public void addEjbModule(String name)
Adds a ejb module to the deployment descriptor.- Parameters:
name
- the name of the new module
-
getVendorDescriptors
public List<Descriptor> getVendorDescriptors()
Returns all vendor descriptors associated with this J2EE deployment descriptor. For example for JBoss the vendor descriptor associated withweb.xml
isjboss-web.xml
.- Specified by:
getVendorDescriptors
in interfaceJ2eeDescriptor
- Returns:
- List of Descriptor objects
-
getFileName
public String getFileName()
Returns the file name of this descriptor. For example "web.xml", "weblogic.xml", etc.- Specified by:
getFileName
in interfaceDescriptor
- Returns:
- the file name
-
-