org.jaxen.jdom
Class DocumentNavigator

java.lang.Object
  |
  +--org.jaxen.DefaultNavigator
        |
        +--org.jaxen.jdom.DocumentNavigator
All Implemented Interfaces:
Navigator, 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
 Iterator getAttributeAxisIterator(Object contextNode)
          Throws UnsupportedAxisException
 String getAttributeName(Object obj)
          Retrieve the name of the given attribute node.
 String getAttributeNamespaceUri(Object obj)
          Retrieve the namespace URI of the given attribute node.
 String getAttributeQName(Object obj)
          Retrieve the QName of the given attribute node.
 String getAttributeStringValue(Object obj)
          Retrieve the string-value of an attribute node.
 Iterator getChildAxisIterator(Object contextNode)
          Throws UnsupportedAxisException
 String getCommentStringValue(Object obj)
          Retrieve the string-value of a comment node.
 Object getDocument(String url)
          Loads a document from the given URI
 Object getDocumentNode(Object contextNode)
          Returns the document node that contains the given context node.
 String getElementName(Object obj)
          Retrieve the name of the given element node.
 String getElementNamespaceUri(Object obj)
          Retrieve the namespace URI of the given element node.
 String getElementQName(Object obj)
          Retrieve the QName of the given element node.
 String getElementStringValue(Object obj)
          Retrieve the string-value of an element node.
static DocumentNavigator getInstance()
           
 Iterator getNamespaceAxisIterator(Object contextNode)
          Throws UnsupportedAxisException
 String getNamespacePrefix(Object obj)
          Retrieve the namespace prefix of a namespace node.
 String getNamespaceStringValue(Object obj)
          Retrieve the string-value of a namespace node.
 Iterator getParentAxisIterator(Object contextNode)
          Throws UnsupportedAxisException
 String getProcessingInstructionData(Object obj)
          Retrieve the data of a processing-instruction.
 String getProcessingInstructionTarget(Object obj)
          Retrieve the target of a processing-instruction.
 String getTextStringValue(Object obj)
          Retrieve the string-value of a text node.
 boolean isAttribute(Object obj)
          Returns whether the given object is an attribute node.
 boolean isComment(Object obj)
          Returns whether the given object is a comment node.
 boolean isDocument(Object obj)
          Returns whether the given object is a document node.
 boolean isElement(Object obj)
          Returns whether the given object is an element node.
 boolean isNamespace(Object obj)
          Returns whether the given object is a namespace node.
 boolean isProcessingInstruction(Object obj)
          Returns whether the given object is a processing-instruction node.
 boolean isText(Object obj)
          Returns whether the given object is a text node.
 XPath parseXPath(String xpath)
          Returns a parsed form of the given xpath string, which will be suitable for queries on JDOM documents.
 String translateNamespacePrefixToUri(String prefix, 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(Object obj)
Description copied from interface: Navigator
Returns whether the given object is an element node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is an element node, else false

isComment

public boolean isComment(Object obj)
Description copied from interface: Navigator
Returns whether the given object is a comment node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is a comment node, else false

isText

public boolean isText(Object obj)
Description copied from interface: Navigator
Returns whether the given object is a text node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is a text node, else false

isAttribute

public boolean isAttribute(Object obj)
Description copied from interface: Navigator
Returns whether the given object is an attribute node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is an attribute node, else false

isProcessingInstruction

public boolean isProcessingInstruction(Object obj)
Description copied from interface: Navigator
Returns whether the given object is a processing-instruction node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is a processing-instruction node, else false

isDocument

public boolean isDocument(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 /.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is a document node, else false

isNamespace

public boolean isNamespace(Object obj)
Description copied from interface: Navigator
Returns whether the given object is a namespace node.
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The object to test.
Returns:
true if the object is a namespace node, else false

getElementName

public String getElementName(Object obj)
Description copied from interface: Navigator
Retrieve the name of the given element node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context element node.
Returns:
The name of the element node.

getElementNamespaceUri

public String getElementNamespaceUri(Object obj)
Description copied from interface: Navigator
Retrieve the namespace URI of the given element node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context element node.
Returns:
The namespace URI of the element node.

getAttributeName

public String getAttributeName(Object obj)
Description copied from interface: Navigator
Retrieve the name of the given attribute node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context attribute node.
Returns:
The name of the attribute node.

getAttributeNamespaceUri

public String getAttributeNamespaceUri(Object obj)
Description copied from interface: Navigator
Retrieve the namespace URI of the given attribute node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context attribute node.
Returns:
The namespace URI of the attribute node.

getChildAxisIterator

public Iterator getChildAxisIterator(Object contextNode)
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException
Overrides:
getChildAxisIterator in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
contextNode - The origin context node.
Returns:
An Iterator capable of traversing the axis.
Throws:
UnsupportedAxisException - is the semantics of this axis are not supported by this object model.

getNamespaceAxisIterator

public Iterator getNamespaceAxisIterator(Object contextNode)
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException
Overrides:
getNamespaceAxisIterator in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
contextNode - The origin context node.
Returns:
An Iterator capable of traversing the axis.
Throws:
UnsupportedAxisException - is the semantics of this axis are not supported by this object model.

getParentAxisIterator

public Iterator getParentAxisIterator(Object contextNode)
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException
Overrides:
getParentAxisIterator in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
contextNode - The origin context node.
Returns:
An Iterator capable of traversing the axis.
Throws:
UnsupportedAxisException - is the semantics of this axis are not supported by this object model.

getAttributeAxisIterator

public Iterator getAttributeAxisIterator(Object contextNode)
Description copied from class: DefaultNavigator
Throws UnsupportedAxisException
Overrides:
getAttributeAxisIterator in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
contextNode - The origin context node.
Returns:
An Iterator capable of traversing the axis.
Throws:
UnsupportedAxisException - is the semantics of this axis are not supported by this object model.

parseXPath

public XPath parseXPath(String xpath)
                 throws org.saxpath.SAXPathException
Returns a parsed form of the given xpath string, which will be suitable for queries on JDOM documents.
Following copied from interface: org.jaxen.Navigator
Parameters:
xpath - The xpath expression.
Returns:
A new XPath expression object.
See Also:
XPath

getDocumentNode

public Object getDocumentNode(Object contextNode)
Description copied from interface: Navigator
Returns the document node that contains the given context node.
Overrides:
getDocumentNode in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
object - The context node.
Returns:
The document of the context node.
See Also:
Navigator.isDocument(Object)

getElementQName

public String getElementQName(Object obj)
Description copied from interface: Navigator
Retrieve the QName of the given element node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context element node.
Returns:
The QName of the element node.

getAttributeQName

public String getAttributeQName(Object obj)
Description copied from interface: Navigator
Retrieve the QName of the given attribute node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The context attribute node.
Returns:
The QName of the attribute node.

getNamespaceStringValue

public String getNamespaceStringValue(Object obj)
Description copied from interface: Navigator
Retrieve the string-value of a namespace node.
Following copied from interface: org.jaxen.Navigator
Parameters:
attr - The namespace node.
Returns:
The string-value of the node.

getNamespacePrefix

public String getNamespacePrefix(Object obj)
Description copied from interface: Navigator
Retrieve the namespace prefix of a namespace node.
Following copied from interface: org.jaxen.Navigator
Parameters:
ns - The namespace node.
Returns:
The prefix associated with the node.

getTextStringValue

public String getTextStringValue(Object obj)
Description copied from interface: Navigator
Retrieve the string-value of a text node.
Following copied from interface: org.jaxen.Navigator
Parameters:
attr - The text node.
Returns:
The string-value of the node.

getAttributeStringValue

public String getAttributeStringValue(Object obj)
Description copied from interface: Navigator
Retrieve the string-value of an attribute node.
Following copied from interface: org.jaxen.Navigator
Parameters:
attr - The attribute node.
Returns:
The string-value of the node.

getElementStringValue

public String getElementStringValue(Object obj)
Description copied from interface: Navigator
Retrieve the string-value of an element node.
Following copied from interface: org.jaxen.Navigator
Parameters:
element - The comment node.
Returns:
The string-value of the node.

getProcessingInstructionTarget

public String getProcessingInstructionTarget(Object obj)
Description copied from interface: Navigator
Retrieve the target of a processing-instruction.
Overrides:
getProcessingInstructionTarget in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
pi - The context processing-instruction node.
Returns:
The target of the processing-instruction node.

getProcessingInstructionData

public String getProcessingInstructionData(Object obj)
Description copied from interface: Navigator
Retrieve the data of a processing-instruction.
Overrides:
getProcessingInstructionData in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
pi - The context processing-instruction node.
Returns:
The data of the processing-instruction node.

getCommentStringValue

public String getCommentStringValue(Object obj)
Description copied from interface: Navigator
Retrieve the string-value of a comment node.
Following copied from interface: org.jaxen.Navigator
Parameters:
comment - The comment node.
Returns:
The string-value of the node.

translateNamespacePrefixToUri

public String translateNamespacePrefixToUri(String prefix,
                                            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.

Overrides:
translateNamespacePrefixToUri in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
prefix - The prefix to translate.
element - The element to consider during translation.
Returns:
The namespace URI associated with the prefix.
See Also:
NamespaceContext

getDocument

public Object getDocument(String url)
                   throws FunctionCallException
Description copied from interface: Navigator
Loads a document from the given URI
Overrides:
getDocument in class DefaultNavigator
Following copied from interface: org.jaxen.Navigator
Parameters:
uri - is the URI of the document to load
Throws:
FunctionCallException - if the document could not be loaded


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

SourceForge Logo