org.jaxen.xom
Class DocumentNavigator

java.lang.Object
  extended byorg.jaxen.DefaultNavigator
      extended byorg.jaxen.xom.DocumentNavigator
All Implemented Interfaces:
Navigator, java.io.Serializable

public class DocumentNavigator
extends DefaultNavigator

Interface for navigating around the XOM object model.

This class is not intended for direct usage, but is used by the Jaxen engine during evaluation.

See Also:
XPath, Serialized Form

Constructor Summary
DocumentNavigator()
           
 
Method Summary
 java.util.Iterator getAttributeAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.lang.String getAttributeName(java.lang.Object o)
          Retrieve the name of the given attribute node.
 java.lang.String getAttributeNamespaceUri(java.lang.Object o)
          Retrieve the namespace URI of the given attribute node.
 java.lang.String getAttributeQName(java.lang.Object o)
          Retrieve the QName of the given attribute node.
 java.lang.String getAttributeStringValue(java.lang.Object o)
          Retrieve the string-value of an attribute node.
 java.util.Iterator getChildAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.lang.String getCommentStringValue(java.lang.Object o)
          Retrieve the string-value of a comment node.
 java.lang.Object getDocument(java.lang.String s)
          Loads a document from the given URI
 java.lang.Object getDocumentNode(java.lang.Object o)
          Returns the document node that contains the given context node.
 java.lang.String getElementName(java.lang.Object o)
          Retrieve the name of the given element node.
 java.lang.String getElementNamespaceUri(java.lang.Object o)
          Retrieve the namespace URI of the given element node.
 java.lang.String getElementQName(java.lang.Object o)
          Retrieve the QName of the given element node.
 java.lang.String getElementStringValue(java.lang.Object o)
          Retrieve the string-value of an element node.
 java.util.Iterator getNamespaceAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.lang.String getNamespacePrefix(java.lang.Object o)
          Retrieve the namespace prefix of a namespace node.
 java.lang.String getNamespaceStringValue(java.lang.Object o)
          Retrieve the string-value of a namespace node.
 java.util.Iterator getParentAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.lang.Object getParentNode(java.lang.Object o)
          Returns the parent of the given context node.
 java.util.Iterator getPrecedingAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.util.Iterator getPrecedingSiblingAxisIterator(java.lang.Object o)
          Throws UnsupportedAxisException
 java.lang.String getProcessingInstructionData(java.lang.Object o)
          Retrieve the data of a processing-instruction.
 java.lang.String getProcessingInstructionTarget(java.lang.Object o)
          Retrieve the target of a processing-instruction.
 java.lang.String getTextStringValue(java.lang.Object o)
          Retrieve the string-value of a text node.
 boolean isAttribute(java.lang.Object o)
          Returns whether the given object is an attribute node.
 boolean isComment(java.lang.Object o)
          Returns whether the given object is a comment node.
 boolean isDocument(java.lang.Object o)
          Returns whether the given object is a document node.
 boolean isElement(java.lang.Object o)
          Returns whether the given object is an element node.
 boolean isNamespace(java.lang.Object o)
          Returns whether the given object is a namespace node.
 boolean isProcessingInstruction(java.lang.Object o)
          Returns whether the given object is a processing-instruction node.
 boolean isText(java.lang.Object o)
          Returns whether the given object is a text node.
 XPath parseXPath(java.lang.String s)
          Returns a parsed form of the given xpath string, which will be suitable for queries on documents that use the same navigator as this one.
 java.lang.String translateNamespacePrefixToUri(java.lang.String s, java.lang.Object o)
          Translate a namespace prefix to a namespace URI, possibly considering a particular element node.
 
Methods inherited from class org.jaxen.DefaultNavigator
getAncestorAxisIterator, getAncestorOrSelfAxisIterator, getDescendantAxisIterator, getDescendantOrSelfAxisIterator, getElementById, getFollowingAxisIterator, getFollowingSiblingAxisIterator, getNodeType, getSelfAxisIterator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentNavigator

public DocumentNavigator()
Method Detail

isAttribute

public boolean isAttribute(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is an attribute node.

Parameters:
o - the object to test.
Returns:
true if the object is an attribute node, else false

isComment

public boolean isComment(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is a comment node.

Parameters:
o - the object to test.
Returns:
true if the object is a comment node, else false

isDocument

public boolean isDocument(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is a document node. A document node is the node that is selected by the xpath expression /.

Parameters:
o - the object to test.
Returns:
true if the object is a document node, else false

isElement

public boolean isElement(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is an element node.

Parameters:
o - the object to test.
Returns:
true if the object is an element node, else false

isNamespace

public boolean isNamespace(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is a namespace node.

Parameters:
o - the object to test.
Returns:
true if the object is a namespace node, else false

isProcessingInstruction

public boolean isProcessingInstruction(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is a processing-instruction node.

Parameters:
o - the object to test.
Returns:
true if the object is a processing-instruction node, else false

isText

public boolean isText(java.lang.Object o)
Description copied from interface: Navigator
Returns whether the given object is a text node.

Parameters:
o - the object to test.
Returns:
true if the object is a text node, else false

getAttributeName

public java.lang.String getAttributeName(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the name of the given attribute node.

Parameters:
o - The context attribute node
Returns:
the name of the attribute node

getAttributeNamespaceUri

public java.lang.String getAttributeNamespaceUri(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the namespace URI of the given attribute node.

Parameters:
o - The context attribute node
Returns:
the namespace URI of the attribute node

getAttributeQName

public java.lang.String getAttributeQName(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the QName of the given attribute node.

Parameters:
o - The context attribute node.
Returns:
the QName of the attribute node.

getAttributeStringValue

public java.lang.String getAttributeStringValue(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the string-value of an attribute node.

Parameters:
o - the attribute node
Returns:
the string-value of the node

getCommentStringValue

public java.lang.String getCommentStringValue(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the string-value of a comment node.

Parameters:
o - the comment node
Returns:
the string-value of the node

getElementName

public java.lang.String getElementName(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the name of the given element node.

Parameters:
o - the context element node
Returns:
the name of the element node

getElementNamespaceUri

public java.lang.String getElementNamespaceUri(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the namespace URI of the given element node.

Parameters:
o - the context element node
Returns:
the namespace URI of the element node

getElementQName

public java.lang.String getElementQName(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the QName of the given element node.

Parameters:
o - the context element node
Returns:
the QName of the element node

getElementStringValue

public java.lang.String getElementStringValue(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the string-value of an element node.

Parameters:
o - The comment node.
Returns:
The string-value of the node.

getNamespacePrefix

public java.lang.String getNamespacePrefix(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the namespace prefix of a namespace node.

Parameters:
o - the namespace node
Returns:
the prefix associated with the node

getNamespaceStringValue

public java.lang.String getNamespaceStringValue(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the string-value of a namespace node.

Parameters:
o - The namespace node
Returns:
the string-value of the node

getTextStringValue

public java.lang.String getTextStringValue(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the string-value of a text node.

Parameters:
o - the text node
Returns:
the string-value of the node

getDocument

public java.lang.Object getDocument(java.lang.String s)
                             throws FunctionCallException
Description copied from interface: Navigator
Loads a document from the given URI

Specified by:
getDocument in interface Navigator
Overrides:
getDocument in class DefaultNavigator
Throws:
FunctionCallException

getDocumentNode

public java.lang.Object getDocumentNode(java.lang.Object o)
Description copied from interface: Navigator
Returns the document node that contains the given context node.

Specified by:
getDocumentNode in interface Navigator
Overrides:
getDocumentNode in class DefaultNavigator

getAttributeAxisIterator

public java.util.Iterator getAttributeAxisIterator(java.lang.Object o)
                                            throws UnsupportedAxisException
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getAttributeAxisIterator in interface Navigator
Overrides:
getAttributeAxisIterator in class DefaultNavigator
Throws:
UnsupportedAxisException

getChildAxisIterator

public java.util.Iterator getChildAxisIterator(java.lang.Object o)
                                        throws UnsupportedAxisException
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getChildAxisIterator in interface Navigator
Overrides:
getChildAxisIterator in class DefaultNavigator
Throws:
UnsupportedAxisException

getParentAxisIterator

public java.util.Iterator getParentAxisIterator(java.lang.Object o)
                                         throws UnsupportedAxisException
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getParentAxisIterator in interface Navigator
Overrides:
getParentAxisIterator in class DefaultNavigator
Throws:
UnsupportedAxisException

getParentNode

public java.lang.Object getParentNode(java.lang.Object o)
                               throws UnsupportedAxisException
Description copied from interface: Navigator
Returns the parent of the given context node.

The parent of any node must either be a document node or an element node.

Specified by:
getParentNode in interface Navigator
Overrides:
getParentNode in class DefaultNavigator
Throws:
UnsupportedAxisException

getPrecedingAxisIterator

public java.util.Iterator getPrecedingAxisIterator(java.lang.Object o)
                                            throws UnsupportedAxisException
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getPrecedingAxisIterator in interface Navigator
Overrides:
getPrecedingAxisIterator in class DefaultNavigator
Throws:
UnsupportedAxisException

getPrecedingSiblingAxisIterator

public java.util.Iterator getPrecedingSiblingAxisIterator(java.lang.Object o)
                                                   throws UnsupportedAxisException
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getPrecedingSiblingAxisIterator in interface Navigator
Overrides:
getPrecedingSiblingAxisIterator in class DefaultNavigator
Throws:
UnsupportedAxisException

getProcessingInstructionData

public java.lang.String getProcessingInstructionData(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the data of a processing-instruction.

Specified by:
getProcessingInstructionData in interface Navigator
Overrides:
getProcessingInstructionData in class DefaultNavigator

getProcessingInstructionTarget

public java.lang.String getProcessingInstructionTarget(java.lang.Object o)
Description copied from interface: Navigator
Retrieve the target of a processing-instruction.

Specified by:
getProcessingInstructionTarget in interface Navigator
Overrides:
getProcessingInstructionTarget in class DefaultNavigator

translateNamespacePrefixToUri

public java.lang.String translateNamespacePrefixToUri(java.lang.String s,
                                                      java.lang.Object o)
Description copied from interface: Navigator
Translate a namespace prefix to a namespace URI, possibly considering a particular element node.

Strictly speaking, prefix-to-URI translation should occur irrespective of any element in the document. This method is provided to allow a non-conforming ease-of-use enhancement.

Specified by:
translateNamespacePrefixToUri in interface Navigator
Overrides:
translateNamespacePrefixToUri in class DefaultNavigator

parseXPath

public XPath parseXPath(java.lang.String s)
                 throws SAXPathException
Description copied from interface: Navigator
Returns a parsed form of the given xpath string, which will be suitable for queries on documents that use the same navigator as this one.

Parameters:
s - the XPath expression
Returns:
a new XPath expression object
Throws:
SAXPathException - if an error occurs while parsing the XPath expression
See Also:
XPath

getNamespaceAxisIterator

public java.util.Iterator getNamespaceAxisIterator(java.lang.Object o)
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException

Specified by:
getNamespaceAxisIterator in interface Navigator
Overrides:
getNamespaceAxisIterator in class DefaultNavigator


Copyright © 2001-2005 Codehaus. All Rights Reserved.