org.codehaus.cargo.module.webapp
Class WebXml

java.lang.Object
  extended by org.jdom.Document
      extended by org.codehaus.cargo.module.AbstractDescriptor
          extended by org.codehaus.cargo.module.webapp.WebXml
All Implemented Interfaces:
Serializable, Cloneable, Descriptor, J2eeDescriptor, org.jdom.Parent

public class WebXml
extends AbstractDescriptor
implements J2eeDescriptor

Encapsulates the DOM representation of a web deployment descriptor web.xml to provide convenience methods for easy access and manipulation.

Version:
$Id: WebXml.java 1705 2008-09-02 13:14:55Z adriana $
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jdom.Document
baseURI
 
Constructor Summary
WebXml()
          Constructor.
WebXml(org.jdom.Element rootElement, DescriptorType type)
          Constructor.
 
Method Summary
 void addTag(DescriptorElement element)
          Add a tag into the document.
 void addVendorDescriptor(VendorWebAppDescriptor descr)
          Associates a vendor specific descriptor with this web.xml.
 String getFileName()
          Returns the file name of this descriptor.
 org.jdom.Element getTag(String tag)
          Get a tag by name.
protected  org.jdom.Namespace getTagNamespace()
          Get the namespace that tags in this descriptor live in.
 Iterator getVendorDescriptors()
          Returns all vendor descriptors associated with this web.xml.
 WebXmlVersion getVersion()
          Returns the servlet API version.
 
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptor
addElement, checkElement, createNestedText, getChildText, getChildText, getDescriptorType, getDocument, getElements, getElements, getImmediateChild, getInsertionPointFor, getNestedElements, getNestedText, getTagByIdentifier, getTagByIdentifier, getTags, getTags, getText
 
Methods inherited from class org.jdom.Document
addContent, addContent, addContent, addContent, clone, cloneContent, detachRootElement, equals, getBaseURI, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getDocType, 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, getTags
 
Methods inherited from interface org.jdom.Parent
clone, cloneContent, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getParent, indexOf, removeContent, removeContent, removeContent, removeContent
 

Constructor Detail

WebXml

public WebXml()
Constructor.


WebXml

public WebXml(org.jdom.Element rootElement,
              DescriptorType type)
Constructor.

Parameters:
rootElement - The root webxml element
type - The descriptor type to use
Method Detail

getFileName

public 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()

addVendorDescriptor

public void addVendorDescriptor(VendorWebAppDescriptor descr)
Associates a vendor specific descriptor with this web.xml.

Parameters:
descr - the vendor specific dexcriptor to associate

getVendorDescriptors

public Iterator getVendorDescriptors()
Returns all vendor descriptors associated with this web.xml.

Specified by:
getVendorDescriptors in interface J2eeDescriptor
Returns:
Iterator containing VendorDescriptors

getTagNamespace

protected org.jdom.Namespace getTagNamespace()
Get the namespace that tags in this descriptor live in.

Returns:
the namespace, or null if none

getVersion

public final WebXmlVersion getVersion()
Returns the servlet API version.

Returns:
The version

addTag

public final void addTag(DescriptorElement element)
Add a tag into the document.

Parameters:
element - The element to add

getTag

public org.jdom.Element getTag(String tag)
Get a tag by name.

Parameters:
tag - The tag name
Returns:
the element for the tag


Copyright © 2004-2012 Codehaus. All Rights Reserved.