de.pannenleiter.db.expr
Class Axis

java.lang.Object
  |
  +--de.pannenleiter.db.expr.Axis

public class Axis
extends java.lang.Object

An axis, that is a direction of navigation in the document structure.


Field Summary
static int ANCESTOR
           
static int ANCESTOR_OR_SELF
           
static int ATTRIBUTE
           
protected  int axisNumber
           
static int CHILD
           
static int DESCENDANT
           
static int DESCENDANT_OR_SELF
           
static int FOLLOWING
           
static int FOLLOWING_SIBLING
           
static java.lang.String[] names
           
static int NAMESPACE
           
protected  NameTest nodeName
           
protected  int nodeType
           
static int PARENT
           
static int PRECEDING
           
static int PRECEDING_SIBLING
           
static int SELF
           
 
Method Summary
 int getNodeType()
           
 int getPrincipalNodeType()
          Get the principal node type for the axis.
static int lookup(java.lang.String name)
          resolve an axis name into a symbolic constant representing the axis
static Axis make(int axisNumber, int nodeType, NameTest nameTest)
          Factory method to make an axis of the specified type.
static Axis makeAxis(int axisNumber)
           
 void setNameTest(NameTest test)
          Set the name test required by the axis.
 void setNodeType(int type)
          Set the node type required by the axis.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ANCESTOR

public static final int ANCESTOR

ANCESTOR_OR_SELF

public static final int ANCESTOR_OR_SELF

ATTRIBUTE

public static final int ATTRIBUTE

CHILD

public static final int CHILD

DESCENDANT

public static final int DESCENDANT

DESCENDANT_OR_SELF

public static final int DESCENDANT_OR_SELF

FOLLOWING

public static final int FOLLOWING

FOLLOWING_SIBLING

public static final int FOLLOWING_SIBLING

NAMESPACE

public static final int NAMESPACE

PARENT

public static final int PARENT

PRECEDING

public static final int PRECEDING

PRECEDING_SIBLING

public static final int PRECEDING_SIBLING

SELF

public static final int SELF

nodeType

protected int nodeType

nodeName

protected NameTest nodeName

axisNumber

protected int axisNumber

names

public static java.lang.String[] names
Method Detail

lookup

public static int lookup(java.lang.String name)
                  throws java.lang.Exception
resolve an axis name into a symbolic constant representing the axis

make

public static Axis make(int axisNumber,
                        int nodeType,
                        NameTest nameTest)
                 throws java.lang.Exception
Factory method to make an axis of the specified type. The use of axisNumber is historic, it would be better for the caller to say directly which Axis subclass it wants to create.

makeAxis

public static Axis makeAxis(int axisNumber)
                     throws java.lang.Exception

setNodeType

public void setNodeType(int type)
Set the node type required by the axis.
Parameters:
nodeType - e.g. NodeInfo.ELEMENT for an element, NodeInfo.NODE for any node type

getPrincipalNodeType

public int getPrincipalNodeType()
Get the principal node type for the axis. This is the default node type, and is Node.ELEMENT for all axes except the Attribute and Namespace axes

getNodeType

public int getNodeType()

setNameTest

public void setNameTest(NameTest test)
Set the name test required by the axis.
Parameters:
nodeType - e.g. NodeInfo.ELEMENT for an element, NodeInfo.NODE for any node type

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object