org.codehaus.cargo.module.webapp.tomcat
Class TomcatContextXml

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

public class TomcatContextXml
extends AbstractDescriptor

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

Version:
$Id: TomcatContextXml.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
TomcatContextXml(org.jdom.Element rootElement, DescriptorType type)
          Constructor.
 
Method Summary
 String getFileName()
          Returns the file name of this descriptor.
 Map getParameters()
          Gets all the parameters that match XPath "Context/Parameter".
 String getPath()
           
 
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
getRootElement
 
Methods inherited from interface org.jdom.Parent
clone, cloneContent, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getParent, indexOf, removeContent, removeContent, removeContent, removeContent
 

Constructor Detail

TomcatContextXml

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

Parameters:
rootElement - The root element of the context
type - the document descriptor type
Method Detail

getPath

public String getPath()
Returns:
the context path element found in the context.xml file (available in the path attribute) or null if not defined

getParameters

public Map getParameters()
Gets all the parameters that match XPath "Context/Parameter".

Returns:
Always non-null (but possibly empty) map keyed by Context/Parameter/@name and value is Context/Parameter/@value

getFileName

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

Returns:
the file name
See Also:
Descriptor.getFileName()


Copyright © 2004-2012 Codehaus. All Rights Reserved.