Package org.jaxen.xom

Class DocumentNavigator

  • All Implemented Interfaces:
    java.io.Serializable, Navigator

    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 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 local name of the given attribute node.
        Parameters:
        o - the context attribute node
        Returns:
        the local 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 qualified name of the given attribute node.
        Parameters:
        o - the context attribute node
        Returns:
        the qualified name 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. This should be the XML 1.0 normalized attribute value. This may be the empty string but must not be null.
        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. This may be the empty string if the comment is empty, but must not be null.
        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 local name of the given element node.
        Parameters:
        o - the context element node
        Returns:
        the local 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 qualified name of the given element node.
        Parameters:
        o - the context element node
        Returns:
        the qualified name 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. This may be the empty string if the element is empty, but must not be null.
        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. This is generally the namespace URI. This may be the empty string but must not be null.
        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. This must not be null and should not be the empty string. The XPath data model does not allow empty text nodes.
        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 class: DefaultNavigator
        Default implementation that always returns null. Override in subclass if the subclass can load documents.
        Specified by:
        getDocument in interface Navigator
        Overrides:
        getDocument in class DefaultNavigator
        Parameters:
        s - the URL of the document to load
        Returns:
        null
        Throws:
        FunctionCallException - if an error occurs while loading the URL; e.g. an I/O error or the document is malformed
      • 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 the string is not a syntactically correct XPath expression
        See Also:
        XPath
      • getNamespaceAxisIterator

        public java.util.Iterator getNamespaceAxisIterator​(java.lang.Object o)
        Description copied from class: DefaultNavigator
        Throws UnsupportedAxisException. Subclasses that support the namespace axis must override this method.
        Specified by:
        getNamespaceAxisIterator in interface Navigator
        Overrides:
        getNamespaceAxisIterator in class DefaultNavigator
        Parameters:
        o - the node to start from
        Returns:
        never returns