org.jaxen.saxpath

Class Axis


public class Axis
extends java.lang.Object

Internal SAXPath class that contains constants representing XPath operators to avoid a lot of string comparisons.

Field Summary

static int
ANCESTOR
The ancestor axis
static int
ANCESTOR_OR_SELF
The ancestor-or-self axis
static int
ATTRIBUTE
The attribute axis
static int
CHILD
The child axis
static int
DESCENDANT
The descendant axis
static int
DESCENDANT_OR_SELF
The descendant-or-self axis
static int
FOLLOWING
The following axis
static int
FOLLOWING_SIBLING
The following-sibling axis
static int
INVALID_AXIS
Marker for an invalid axis
static int
NAMESPACE
The namespace axis
static int
PARENT
The parent axis
static int
PRECEDING
The preceding axis
static int
PRECEDING_SIBLING
The preceding-sibling axis
static int
SELF
The self axis

Constructor Summary

Axis()

Method Summary

static int
lookup(String axisName)
Returns the code for an axis given its name.
static String
lookup(int axisNum)
Returns the name of the axis.

Field Details

ANCESTOR

public static final int ANCESTOR
The ancestor axis
Field Value:
4

ANCESTOR_OR_SELF

public static final int ANCESTOR_OR_SELF
The ancestor-or-self axis
Field Value:
13

ATTRIBUTE

public static final int ATTRIBUTE
The attribute axis
Field Value:
9

CHILD

public static final int CHILD
The child axis
Field Value:
1

DESCENDANT

public static final int DESCENDANT
The descendant axis
Field Value:
2

DESCENDANT_OR_SELF

public static final int DESCENDANT_OR_SELF
The descendant-or-self axis
Field Value:
12

FOLLOWING

public static final int FOLLOWING
The following axis
Field Value:
7

FOLLOWING_SIBLING

public static final int FOLLOWING_SIBLING
The following-sibling axis
Field Value:
5

INVALID_AXIS

public static final int INVALID_AXIS
Marker for an invalid axis
Field Value:
0

NAMESPACE

public static final int NAMESPACE
The namespace axis
Field Value:
10

PARENT

public static final int PARENT
The parent axis
Field Value:
3

PRECEDING

public static final int PRECEDING
The preceding axis
Field Value:
8

PRECEDING_SIBLING

public static final int PRECEDING_SIBLING
The preceding-sibling axis
Field Value:
6

SELF

public static final int SELF
The self axis
Field Value:
11

Constructor Details

Axis

private Axis()

Method Details

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

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