org.codehaus.cargo.module.application
Class ApplicationXml

java.lang.Object
  extended by org.codehaus.cargo.module.AbstractDescriptor
      extended by org.codehaus.cargo.module.application.ApplicationXml
All Implemented Interfaces:
Descriptor, J2eeDescriptor

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.

Version:
$Id: ApplicationXml.java 1119 2006-07-22 13:16:54Z vmassol $

Constructor Summary
ApplicationXml(org.w3c.dom.Document theDocument)
          Constructor.
 
Method Summary
 void addEjbModule(java.lang.String name)
          Adds a ejb module to the deployment descriptor.
 void addWebModule(java.lang.String uri, java.lang.String context)
          Adds a web module to the deployment descriptor.
 java.util.Iterator getEjbModules()
          Returns an iterator over the ejb modules defined in the descriptor.
 java.util.Iterator getElements(ApplicationXmlTag tag)
          Returns an iterator over the elements that match the specified tag.
 java.lang.String getFileName()
          Returns the file name of this descriptor.
 java.util.Iterator getVendorDescriptors()
          Returns all vendor descriptors associated with this J2EE deployment descriptor.
 ApplicationXmlVersion getVersion()
           
 org.w3c.dom.Element getWebModule(java.lang.String webUri)
          Returns the element that contains the definition of a specific web module, or null if a web module with the specified web-uri is not defined.
 java.lang.String getWebModuleContextRoot(java.lang.String webUri)
          Returns the context root of the the specified web module.
 java.util.Iterator getWebModuleUris()
          Returns an iterator over the URIs of the web modules defined in the descriptor.
 
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptor
addElement, checkElement, createNestedText, getChildText, getDocument, getElements, getImmediateChild, getInsertionPointFor, getNestedElements, getNestedText, getRootElement, getText, replaceElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.codehaus.cargo.module.Descriptor
getDocument
 

Constructor Detail

ApplicationXml

public ApplicationXml(org.w3c.dom.Document theDocument)
Constructor.

Parameters:
theDocument - The DOM document representing the parsed deployment descriptor
Method Detail

getVersion

public ApplicationXmlVersion getVersion()
Returns:
The J2EE API version.

getWebModule

public org.w3c.dom.Element getWebModule(java.lang.String webUri)
Returns the element that contains the definition of a specific web module, or null 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 java.lang.String getWebModuleContextRoot(java.lang.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 java.util.Iterator getWebModuleUris()
Returns an iterator over the URIs of the web modules defined in the descriptor.

Returns:
An iterator over the URIs of the web modules

getEjbModules

public java.util.Iterator getEjbModules()
Returns an iterator over the ejb modules defined in the descriptor.

Returns:
An iterator of Strings over the ejb modules

getElements

public java.util.Iterator getElements(ApplicationXmlTag tag)
Returns an iterator over the elements that match the specified tag.

Parameters:
tag - The descriptor tag of which the elements should be returned
Returns:
An iterator over the elements matching the tag, in the order they occur in the descriptor

addWebModule

public void addWebModule(java.lang.String uri,
                         java.lang.String context)
Adds a web module to the deployment descriptor.

Parameters:
uri - the uri of the new module
context - the context of the new module

addEjbModule

public void addEjbModule(java.lang.String name)
Adds a ejb module to the deployment descriptor.

Parameters:
name - the name of the new module

getVendorDescriptors

public java.util.Iterator getVendorDescriptors()
Returns all vendor descriptors associated with this J2EE deployment descriptor. For example for JBoss the vendor descriptor associated with web.xml is jboss-web.xml.

Specified by:
getVendorDescriptors in interface J2eeDescriptor
Returns:
Iterator containing Descriptor objects
See Also:
J2eeDescriptor.getVendorDescriptors()

getFileName

public java.lang.String getFileName()
Returns the file name of this descriptor. For example "web.xml", "weblogic.xml", etc.

Specified by:
getFileName in interface Descriptor
Returns:
the file name
See Also:
Descriptor.getFileName()


Copyright © 2004-2009 Codehaus. All Rights Reserved.