Package org.jaxen.xom
Class DocumentNavigator
java.lang.Object
org.jaxen.DefaultNavigator
org.jaxen.xom.DocumentNavigator
- All Implemented Interfaces:
Serializable,Navigator
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:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieve anIteratormatching theattributeXPath axis.Retrieve the local name of the given attribute node.Retrieve the namespace URI of the given attribute node.Retrieve the qualified name of the given attribute node.Retrieve the string-value of an attribute node.ThrowsUnsupportedAxisException.Retrieve the string-value of a comment node.Default implementation that always returns null.Returns null.Retrieve the local name of the given element node.Retrieve the namespace URI of the given element node.Retrieve the qualified name of the given element node.Retrieve the string-value of an element node.ThrowsUnsupportedAxisException.Retrieve the namespace prefix of a namespace node.Retrieve the string-value of a namespace node.ThrowsUnsupportedAxisException.Default inefficient implementation.Retrieve anIteratormatching theprecedingXPath axis.Retrieve anIteratormatching thepreceding-siblingXPath axis.Returns null.Returns null.Retrieve the string-value of a text node.booleanReturns whether the given object is an attribute node.booleanReturns whether the given object is a comment node.booleanisDocument(Object o) Returns whether the given object is a document node.booleanReturns whether the given object is an element node.booleanReturns whether the given object is a namespace node.booleanReturns whether the given object is a processing-instruction node.booleanReturns whether the given object is a text node.parseXPath(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.Returns null.Methods inherited from class org.jaxen.DefaultNavigator
getAncestorAxisIterator, getAncestorOrSelfAxisIterator, getDescendantAxisIterator, getDescendantOrSelfAxisIterator, getElementById, getFollowingAxisIterator, getFollowingSiblingAxisIterator, getNodeType, getSelfAxisIterator
-
Constructor Details
-
DocumentNavigator
public DocumentNavigator()
-
-
Method Details
-
isAttribute
Description copied from interface:NavigatorReturns whether the given object is an attribute node.- Parameters:
o- the object to test- Returns:
trueif the object is an attribute node, elsefalse
-
isComment
Description copied from interface:NavigatorReturns whether the given object is a comment node.- Parameters:
o- the object to test- Returns:
trueif the object is a comment node, elsefalse
-
isDocument
Description copied from interface:NavigatorReturns 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:
trueif the object is a document node, elsefalse
-
isElement
Description copied from interface:NavigatorReturns whether the given object is an element node.- Parameters:
o- the object to test- Returns:
trueif the object is an element node, elsefalse
-
isNamespace
Description copied from interface:NavigatorReturns whether the given object is a namespace node.- Parameters:
o- the object to test- Returns:
trueif the object is a namespace node, elsefalse
-
isProcessingInstruction
Description copied from interface:NavigatorReturns whether the given object is a processing-instruction node.- Parameters:
o- the object to test- Returns:
trueif the object is a processing-instruction node, elsefalse
-
isText
Description copied from interface:NavigatorReturns whether the given object is a text node.- Parameters:
o- the object to test- Returns:
trueif the object is a text node, elsefalse
-
getAttributeName
Description copied from interface:NavigatorRetrieve the local name of the given attribute node.- Parameters:
o- the context attribute node- Returns:
- the local name of the attribute node
-
getAttributeNamespaceUri
Description copied from interface:NavigatorRetrieve the namespace URI of the given attribute node.- Parameters:
o- the context attribute node- Returns:
- the namespace URI of the attribute node
-
getAttributeQName
Description copied from interface:NavigatorRetrieve the qualified name of the given attribute node.- Parameters:
o- the context attribute node- Returns:
- the qualified name of the attribute node
-
getAttributeStringValue
Description copied from interface:NavigatorRetrieve 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
Description copied from interface:NavigatorRetrieve 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
Description copied from interface:NavigatorRetrieve the local name of the given element node.- Parameters:
o- the context element node- Returns:
- the local name of the element node
-
getElementNamespaceUri
Description copied from interface:NavigatorRetrieve the namespace URI of the given element node.- Parameters:
o- the context element node- Returns:
- the namespace URI of the element node
-
getElementQName
Description copied from interface:NavigatorRetrieve the qualified name of the given element node.- Parameters:
o- the context element node- Returns:
- the qualified name of the element node
-
getElementStringValue
Description copied from interface:NavigatorRetrieve 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
Description copied from interface:NavigatorRetrieve the namespace prefix of a namespace node.- Parameters:
o- the namespace node- Returns:
- the prefix associated with the node
-
getNamespaceStringValue
Description copied from interface:NavigatorRetrieve 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
Description copied from interface:NavigatorRetrieve 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
Description copied from class:DefaultNavigatorDefault implementation that always returns null. Override in subclass if the subclass can load documents.- Specified by:
getDocumentin interfaceNavigator- Overrides:
getDocumentin classDefaultNavigator- 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
-
getDocumentNode
Description copied from class:DefaultNavigatorReturns null.- Specified by:
getDocumentNodein interfaceNavigator- Overrides:
getDocumentNodein classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- null
- See Also:
-
getAttributeAxisIterator
Description copied from class:DefaultNavigatorRetrieve anIteratormatching theattributeXPath axis.- Specified by:
getAttributeAxisIteratorin interfaceNavigator- Overrides:
getAttributeAxisIteratorin classDefaultNavigator- Parameters:
o- the original context node- Returns:
- an Iterator capable of traversing the axis, not null
-
getChildAxisIterator
Description copied from class:DefaultNavigatorThrowsUnsupportedAxisException. Subclasses should override this method.- Specified by:
getChildAxisIteratorin interfaceNavigator- Overrides:
getChildAxisIteratorin classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- never returns
-
getParentAxisIterator
Description copied from class:DefaultNavigatorThrowsUnsupportedAxisException. Subclasses should override this method.- Specified by:
getParentAxisIteratorin interfaceNavigator- Overrides:
getParentAxisIteratorin classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- never returns
-
getParentNode
Description copied from class:DefaultNavigatorDefault inefficient implementation. Subclasses should override this method.- Specified by:
getParentNodein interfaceNavigator- Overrides:
getParentNodein classDefaultNavigator- Parameters:
o- the node whose parent to return- Returns:
- the parent node
- See Also:
-
getPrecedingAxisIterator
Description copied from class:DefaultNavigatorRetrieve anIteratormatching theprecedingXPath axis.- Specified by:
getPrecedingAxisIteratorin interfaceNavigator- Overrides:
getPrecedingAxisIteratorin classDefaultNavigator- Parameters:
o- the original context node- Returns:
- an Iterator capable of traversing the axis, not null
- Throws:
UnsupportedAxisException- if the semantics of the preceding axis are not supported by this object model
-
getPrecedingSiblingAxisIterator
Description copied from class:DefaultNavigatorRetrieve anIteratormatching thepreceding-siblingXPath axis.- Specified by:
getPrecedingSiblingAxisIteratorin interfaceNavigator- Overrides:
getPrecedingSiblingAxisIteratorin classDefaultNavigator- Parameters:
o- the original context node- Returns:
- an Iterator capable of traversing the axis, not null
- Throws:
UnsupportedAxisException- if the semantics of the preceding-sibling axis are not supported by this object model
-
getProcessingInstructionData
Description copied from class:DefaultNavigatorReturns null.- Specified by:
getProcessingInstructionDatain interfaceNavigator- Overrides:
getProcessingInstructionDatain classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- null
-
getProcessingInstructionTarget
Description copied from class:DefaultNavigatorReturns null.- Specified by:
getProcessingInstructionTargetin interfaceNavigator- Overrides:
getProcessingInstructionTargetin classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- null
-
translateNamespacePrefixToUri
Description copied from class:DefaultNavigatorReturns null.- Specified by:
translateNamespacePrefixToUriin interfaceNavigator- Overrides:
translateNamespacePrefixToUriin classDefaultNavigator- Parameters:
s- the prefix to translateo- the node to start from- Returns:
- null
- See Also:
-
parseXPath
Description copied from interface:NavigatorReturns 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:
-
getNamespaceAxisIterator
Description copied from class:DefaultNavigatorThrowsUnsupportedAxisException. Subclasses that support the namespace axis must override this method.- Specified by:
getNamespaceAxisIteratorin interfaceNavigator- Overrides:
getNamespaceAxisIteratorin classDefaultNavigator- Parameters:
o- the node to start from- Returns:
- never returns
-