org.jagatoo.util.xml
Class XMLPath

java.lang.Object
  extended by org.jagatoo.util.xml.XMLPath

public class XMLPath
extends java.lang.Object

Keeps the current XML parsing path.

Author:
Marvin Froehlich (aka Qudus)

Field Summary
static int DEFAULT_INITIAL_SIZE
           
 
Method Summary
 java.lang.String getElement(int level)
          Gets the path element by level.
 java.lang.String getLastPathElement()
          Gets the path element last in the current order.
 java.lang.Object getLastPathObject()
          Gets the path element last in the current order.
 int getLevel()
          Gets the current hierarchy level. 0 is document root, 1 is inside a root element.
 java.lang.Object getObject(int level)
          Gets the path element by level.
 boolean isAt(boolean compareIgnoringCase, java.lang.String... elements)
          Checks, whether the current path is composed of the given elements.
 boolean isAtByObjects(boolean doEqualsTest, java.lang.String... objects)
          Checks, whether the current path is composed of the given element objects (see SimpleXMLHandlerDelegate.getPathObject(XMLPath, String)).
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_INITIAL_SIZE

public static final int DEFAULT_INITIAL_SIZE
See Also:
Constant Field Values
Method Detail

getElement

public final java.lang.String getElement(int level)
Gets the path element by level.

Parameters:
level -
Returns:
the path element by level.

getObject

public final java.lang.Object getObject(int level)
Gets the path element by level.

Parameters:
level -
Returns:
the path element by level.

getLastPathElement

public final java.lang.String getLastPathElement()
Gets the path element last in the current order.

Returns:
the path element last in the current order.

getLastPathObject

public final java.lang.Object getLastPathObject()
Gets the path element last in the current order.

Returns:
the path element last in the current order.

getLevel

public final int getLevel()
Gets the current hierarchy level. 0 is document root, 1 is inside a root element.

Returns:
the current hierarchy level.

isAt

public final boolean isAt(boolean compareIgnoringCase,
                          java.lang.String... elements)
Checks, whether the current path is composed of the given elements.

Parameters:
compareIgnoringCase -
elements -
Returns:

isAtByObjects

public final boolean isAtByObjects(boolean doEqualsTest,
                                   java.lang.String... objects)
Checks, whether the current path is composed of the given element objects (see SimpleXMLHandlerDelegate.getPathObject(XMLPath, String)).

Parameters:
doEqualsTest -
objects -
Returns:

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object