org.jaxen.saxpath

Class Axis

public class Axis extends Object

Internal SAXPath class that contains constants representing XPath operators to avoid a lot of string comparisons.
Field Summary
static intANCESTOR
The ancestor axis
static intANCESTOR_OR_SELF
The ancestor-or-self axis
static intATTRIBUTE
The attribute axis
static intCHILD
The child axis
static intDESCENDANT
The descendant axis
static intDESCENDANT_OR_SELF
The descendant-or-self axis
static intFOLLOWING
The following axis
static intFOLLOWING_SIBLING
The following-sibling axis
static intINVALID_AXIS
Marker for an invalid axis
static intNAMESPACE
The namespace axis
static intPARENT
The parent axis
static intPRECEDING
The preceding axis
static intPRECEDING_SIBLING
The preceding-sibling axis
static intSELF
The self axis
Constructor Summary
Axis()
Method Summary
static Stringlookup(int axisNum)

Returns the name of the axis.

static intlookup(String axisName)

Returns the code for an axis given its name.

Field Detail

ANCESTOR

public static final int ANCESTOR
The ancestor axis

ANCESTOR_OR_SELF

public static final int ANCESTOR_OR_SELF
The ancestor-or-self axis

ATTRIBUTE

public static final int ATTRIBUTE
The attribute axis

CHILD

public static final int CHILD
The child axis

DESCENDANT

public static final int DESCENDANT
The descendant axis

DESCENDANT_OR_SELF

public static final int DESCENDANT_OR_SELF
The descendant-or-self axis

FOLLOWING

public static final int FOLLOWING
The following axis

FOLLOWING_SIBLING

public static final int FOLLOWING_SIBLING
The following-sibling axis

INVALID_AXIS

public static final int INVALID_AXIS
Marker for an invalid axis

NAMESPACE

public static final int NAMESPACE
The namespace axis

PARENT

public static final int PARENT
The parent axis

PRECEDING

public static final int PRECEDING
The preceding axis

PRECEDING_SIBLING

public static final int PRECEDING_SIBLING
The preceding-sibling axis

SELF

public static final int SELF
The self axis

Constructor Detail

Axis

private Axis()

Method Detail

lookup

public static String lookup(int axisNum)

Returns the name of the axis.

Parameters: axisNum the axis code

Returns: the name of the axis such as might be used in an XPath expression

Throws: JaxenRuntimeException if the number does not represent one of the 13 XPath axes

lookup

public static int lookup(String axisName)

Returns the code for an axis given its name.

Parameters: axisName the name of the axis: child, parent, descendant, descendant-or-self, etc.

Returns: the axis code