org.planx.xpath
Interface Navigator

All Known Implementing Classes:
DOMNavigator, XMLStoreNavigator

public interface Navigator

A Navigator is a bridge between XPath and a document model.


Field Summary
static int ATTRIBUTE
           
static int COMMENT
           
static int ELEMENT
           
static int NAMESPACE
           
static int PROCESSING_INSTRUCTION
           
static int ROOT
           
static int TEXT
           
 
Method Summary
 int attributeCount(Object node)
          Return the number of attributes of the specified node.
 int childCount(Object node)
          Return the number of children of the specified node.
 Object getAttribute(Object node, int index)
          Return the attribute of the specified node with the specified attribute index.
 Object getChild(Object node, int index)
          Return the child of the specified node with the specified child index.
 String getName(Object node)
          Return the name of the specified node.
 Object getParent(Object node)
          Return the parent of the specified node or null if it does not have a parent.
 Object getRoot(Object node)
          Return the root node of the document to which the specified node belongs.
 String getStringValue(Object node)
          Return the value of the specified node as defined in the XPath specification.
 int getType(Object node)
          Return the type of the node as specified in this interface.
 Object nextSibling(Object node)
          Return the next sibling of the specified node or null if it does not have a one.
 Object previousSibling(Object node)
          Return the previous sibling of the specified node or null if it does not have a one.
 

Field Detail

ROOT

static final int ROOT
See Also:
Constant Field Values

ELEMENT

static final int ELEMENT
See Also:
Constant Field Values

TEXT

static final int TEXT
See Also:
Constant Field Values

ATTRIBUTE

static final int ATTRIBUTE
See Also:
Constant Field Values

NAMESPACE

static final int NAMESPACE
See Also:
Constant Field Values

PROCESSING_INSTRUCTION

static final int PROCESSING_INSTRUCTION
See Also:
Constant Field Values

COMMENT

static final int COMMENT
See Also:
Constant Field Values
Method Detail

getRoot

Object getRoot(Object node)
               throws XPathException
Return the root node of the document to which the specified node belongs.

Throws:
XPathException

getParent

Object getParent(Object node)
                 throws XPathException
Return the parent of the specified node or null if it does not have a parent.

Throws:
XPathException

nextSibling

Object nextSibling(Object node)
                   throws XPathException
Return the next sibling of the specified node or null if it does not have a one.

Throws:
XPathException

previousSibling

Object previousSibling(Object node)
                       throws XPathException
Return the previous sibling of the specified node or null if it does not have a one.

Throws:
XPathException

getChild

Object getChild(Object node,
                int index)
                throws XPathException
Return the child of the specified node with the specified child index.

Throws:
XPathException

childCount

int childCount(Object node)
               throws XPathException
Return the number of children of the specified node.

Throws:
XPathException

getAttribute

Object getAttribute(Object node,
                    int index)
                    throws XPathException
Return the attribute of the specified node with the specified attribute index. Note that the indexing is merely for convenience and does not imply a specific ordering of the attributes.

Throws:
XPathException

attributeCount

int attributeCount(Object node)
                   throws XPathException
Return the number of attributes of the specified node.

Throws:
XPathException

getName

String getName(Object node)
               throws XPathException
Return the name of the specified node. For element nodes this is the name of the node. For text node this is null. For attribute nodes this is the name of the attribute.

Throws:
XPathException

getStringValue

String getStringValue(Object node)
                      throws XPathException
Return the value of the specified node as defined in the XPath specification. For element nodes this is the concatenation of the values of the descendant text nodes. For text nodes this is the character contents of the node. For attribute nodes this is the value of the attribute.

Throws:
XPathException

getType

int getType(Object node)
            throws XPathException
Return the type of the node as specified in this interface.

Throws:
XPathException


Copyright © 2010. All Rights Reserved.