VdexReload 1.1.3 API

uk.ac.reload.moonunit.dom
Class DomPath

java.lang.Object
  extended byuk.ac.reload.moonunit.dom.DomPath
All Implemented Interfaces:
MoonUnitConstants

public class DomPath
extends java.lang.Object
implements MoonUnitConstants

This encapsulates the JDOM Path of a given Element and Attribute


Field Summary
static java.lang.String XMLATTSEPARATOR
          The Path separator used for xml attributes
static java.lang.String XMLPATHSEPARATOR
          The Path separator used for xml elements
 
Fields inherited from interface uk.ac.reload.moonunit.MoonUnitConstants
DEBUG
 
Constructor Summary
DomPath(java.lang.String path)
          Constructor that takes in a path string.
 
Method Summary
 java.lang.String appendAttributeName(java.lang.String attributeName)
          Append an Attribute name to the Path
 java.lang.String appendElementName(java.lang.String elementName)
          Append an Element name to the Path
 boolean endsWith(DomPath domPath)
          Return true if the path part endsWith
 boolean equals(DomPath domPath)
          Return true if the path part equals
 java.lang.String getAttributePart()
          Return the Attribute part of this path if it contains one, or null
static DomPath getDomPath(org.jdom.Attribute attribute)
          Gets the DOM Path of the given JDOM attribute
static DomPath getDomPath(org.jdom.Element element)
          Gets the DOM Path of the given element
 java.util.StringTokenizer getElements()
          Return an Enumeration of the Elements as a StringTokenizer
 java.lang.String getElementsPart()
          Return the Elements part of this path
 java.lang.String getPath()
          Get the Path String
 java.lang.String getRootPart()
          Get the Root name of this Path
 boolean isAttribute()
          Return true if this path describes an Attribute
 java.lang.String prependElementName(java.lang.String elementName)
          Prepend an Element name to the Path
 java.lang.String toString()
          Get the path string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XMLPATHSEPARATOR

public static java.lang.String XMLPATHSEPARATOR
The Path separator used for xml elements


XMLATTSEPARATOR

public static java.lang.String XMLATTSEPARATOR
The Path separator used for xml attributes

Constructor Detail

DomPath

public DomPath(java.lang.String path)
Constructor that takes in a path string.

Parameters:
path - the actual path string
Method Detail

getPath

public java.lang.String getPath()
Get the Path String

Returns:
the path string

appendElementName

public java.lang.String appendElementName(java.lang.String elementName)
Append an Element name to the Path

Parameters:
elementName - to be appended to the path
Returns:
the full path string

prependElementName

public java.lang.String prependElementName(java.lang.String elementName)
Prepend an Element name to the Path

Parameters:
elementName - to be prepended to the path
Returns:
the full path string

appendAttributeName

public java.lang.String appendAttributeName(java.lang.String attributeName)
Append an Attribute name to the Path

Parameters:
attributeName - to be appended to the path
Returns:
the full path string

getElements

public java.util.StringTokenizer getElements()
Return an Enumeration of the Elements as a StringTokenizer

Returns:
the StringTokenizer

isAttribute

public boolean isAttribute()
Return true if this path describes an Attribute

Returns:
true if this path describes an attribute, false otherwise

getAttributePart

public java.lang.String getAttributePart()
Return the Attribute part of this path if it contains one, or null

Returns:
the attribute part of this path if it contains one, null otherwise

getElementsPart

public java.lang.String getElementsPart()
Return the Elements part of this path

Returns:
the elements part of this path

getRootPart

public java.lang.String getRootPart()
Get the Root name of this Path

Returns:
the root name of this path

equals

public boolean equals(DomPath domPath)
Return true if the path part equals

Parameters:
domPath - to check for equality with the current path
Returns:
true if the path part equals to the given path, false otherwise

endsWith

public boolean endsWith(DomPath domPath)
Return true if the path part endsWith

Parameters:
domPath - to check for endsWith with the current path
Returns:
true if the path part endsWith the given path, false otherwise

toString

public java.lang.String toString()
Get the path string

Returns:
the path string

getDomPath

public static DomPath getDomPath(org.jdom.Element element)
Gets the DOM Path of the given element

Parameters:
element - the element for which you want the DOM Path
Returns:
a DOM Path for a JDOM Element

getDomPath

public static DomPath getDomPath(org.jdom.Attribute attribute)
Gets the DOM Path of the given JDOM attribute

Parameters:
attribute - the given JDOM attribute
Returns:
a DOM Path for a JDOM Attribute

VdexReload 1.1.3 API