org.jaxen.jdom
Class DocumentNavigator

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

public class DocumentNavigator
extends DefaultNavigator

Interface for navigating around the EXML object model.

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

Author:
bob mcwhirter
See Also:
XPath, Serialized Form

Constructor Summary
DocumentNavigator()
           
 
Method Summary
 java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode)
          Throws UnsupportedAxisException
 java.lang.String getAttributeName(java.lang.Object obj)
          Retrieve the name of the given attribute node.
 java.lang.String getAttributeNamespaceUri(java.lang.Object obj)
          Retrieve the namespace URI of the given attribute node.
 java.lang.String getAttributeQName(java.lang.Object obj)
          Retrieve the QName of the given attribute node.
 java.lang.String getAttributeStringValue(java.lang.Object obj)
          Retrieve the string-value of an attribute node.
 java.util.Iterator getChildAxisIterator(java.lang.Object contextNode)
          Throws UnsupportedAxisException
 java.lang.String getCommentStringValue(java.lang.Object obj)
          Retrieve the string-value of a comment node.
 java.lang.Object getDocument(java.lang.String url)
          Loads a document from the given URI
 java.lang.Object getDocumentNode(java.lang.Object contextNode)
          Returns the document node that contains the given context node.
 java.lang.String getElementName(java.lang.Object obj)
          Retrieve the name of the given element node.
 java.lang.String getElementNamespaceUri(java.lang.Object obj)
          Retrieve the namespace URI of the given element node.
 java.lang.String getElementQName(java.lang.Object obj)
          Retrieve the QName of the given element node.
 java.lang.String getElementStringValue(java.lang.Object obj)
          Retrieve the string-value of an element node.
static DocumentNavigator getInstance()
           
 java.util.Iterator getNamespaceAxisIterator(java.lang.Object contextNode)
          Throws UnsupportedAxisException
 java.lang.String getNamespacePrefix(java.lang.Object obj)
          Retrieve the namespace prefix of a namespace node.
 java.lang.String getNamespaceStringValue(java.lang.Object obj)
          Retrieve the string-value of a namespace node.
 java.util.Iterator getParentAxisIterator(java.lang.Object contextNode)
          Throws UnsupportedAxisException
 java.lang.String getProcessingInstructionData(java.lang.Object obj)
          Retrieve the data of a processing-instruction.
 java.lang.String getProcessingInstructionTarget(java.lang.Object obj)
          Retrieve the target of a processing-instruction.
 java.lang.String getTextStringValue(java.lang.Object obj)
          Retrieve the string-value of a text node.
 boolean isAttribute(java.lang.Object obj)
          Returns whether the given object is an attribute node.
 boolean isComment(java.lang.Object obj)
          Returns whether the given object is a comment node.
 boolean isDocument(java.lang.Object obj)
          Returns whether the given object is a document node.
 boolean isElement(java.lang.Object obj)
          Returns whether the given object is an element node.
 boolean isNamespace(java.lang.Object obj)
          Returns whether the given object is a namespace node.
 boolean isProcessingInstruction(java.lang.Object obj)
          Returns whether the given object is a processing-instruction node.
 boolean isText(java.lang.Object obj)
          Returns whether the given object is a text node.
 XPath parseXPath(java.lang.String xpath)
          Returns a parsed form of the given xpath string, which will be suitable for queries on JDOM documents.
 java.lang.String translateNamespacePrefixToUri(java.lang.String prefix, java.lang.Object context)
          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, getParentNode, getPrecedingAxisIterator, getPrecedingSiblingAxisIterator, 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

getInstance

public static DocumentNavigator getInstance()

isElement

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

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

isComment

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

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

isText

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

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

isAttribute

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

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

isProcessingInstruction

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

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

isDocument

public boolean isDocument(java.lang.Object obj)
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:
obj - The object to test.
Returns:
true if the object is a document node, else false

isNamespace

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

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

getElementName

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

Parameters:
obj - The context element node.
Returns:
The name of the element node.

getElementNamespaceUri

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

Parameters:
obj - The context element node.
Returns:
The namespace URI of the element node.

getAttributeName

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

Returns:
The name of the attribute node.

getAttributeNamespaceUri

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

Returns:
The namespace URI of the attribute node.

getChildAxisIterator

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

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

getNamespaceAxisIterator

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

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

getParentAxisIterator

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

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

getAttributeAxisIterator

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

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

parseXPath

public XPath parseXPath(java.lang.String xpath)
                 throws org.saxpath.SAXPathException
Returns a parsed form of the given xpath string, which will be suitable for queries on JDOM documents.

Parameters:
xpath - The xpath expression.
Returns:
A new XPath expression object.
Throws:
org.saxpath.SAXPathException
See Also:
XPath

getDocumentNode

public java.lang.Object getDocumentNode(java.lang.Object contextNode)
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

getElementQName

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

Parameters:
obj - The context element node.
Returns:
The QName of the element node.

getAttributeQName

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

Returns:
The QName of the attribute node.

getNamespaceStringValue

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

Returns:
The string-value of the node.

getNamespacePrefix

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

Parameters:
obj - The namespace node.
Returns:
The prefix associated with the node.

getTextStringValue

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

Returns:
The string-value of the node.

getAttributeStringValue

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

Parameters:
obj - The attribute node.
Returns:
The string-value of the node.

getElementStringValue

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

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

getProcessingInstructionTarget

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

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

getProcessingInstructionData

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

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

getCommentStringValue

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

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

translateNamespacePrefixToUri

public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix,
                                                      java.lang.Object context)
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

getDocument

public java.lang.Object getDocument(java.lang.String url)
                             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


Copyright © 2002 bob mcwhirter & James Strachan. All Rights Reserved. Hosted by

SourceForge Logo