public interface Navigator extends Serializable
There is a method to obtain a java.util.Iterator,
for each axis specified by XPath. If the target object model
does not support the semantics of a particular axis, an
UnsupportedAxisException is to be thrown.
| Modifier and Type | Method and Description |
|---|---|
Iterator |
getAncestorAxisIterator(Object contextNode)
Retrieve an
Iterator matching the ancestor
xpath axis. |
Iterator |
getAncestorOrSelfAxisIterator(Object contextNode)
Retrieve an
Iterator matching the
ancestor-or-self xpath axis. |
Iterator |
getAttributeAxisIterator(Object contextNode)
Retrieve an
Iterator matching the attribute
xpath axis. |
String |
getAttributeName(Object attr)
Retrieve the name of the given attribute node.
|
String |
getAttributeNamespaceUri(Object attr)
Retrieve the namespace URI of the given attribute node.
|
String |
getAttributeQName(Object attr)
Retrieve the QName of the given attribute node.
|
String |
getAttributeStringValue(Object attr)
Retrieve the string-value of an attribute node.
|
Iterator |
getChildAxisIterator(Object contextNode)
Retrieve an
Iterator matching the child
xpath axis. |
String |
getCommentStringValue(Object comment)
Retrieve the string-value of a comment node.
|
Iterator |
getDescendantAxisIterator(Object contextNode)
Retrieve an
Iterator matching the descendant
xpath axis. |
Iterator |
getDescendantOrSelfAxisIterator(Object contextNode)
Retrieve an
Iterator matching the
descendant-or-self xpath axis. |
Object |
getDocument(String uri)
Loads a document from the given URI
|
Object |
getDocumentNode(Object contextNode)
Returns the document node that contains the given context node.
|
Object |
getElementById(Object contextNode,
String elementId)
Returns the element whose ID is given by elementId.
|
String |
getElementName(Object element)
Retrieve the name of the given element node.
|
String |
getElementNamespaceUri(Object element)
Retrieve the namespace URI of the given element node.
|
String |
getElementQName(Object element)
Retrieve the QName of the given element node.
|
String |
getElementStringValue(Object element)
Retrieve the string-value of an element node.
|
Iterator |
getFollowingAxisIterator(Object contextNode)
Retrieve an
Iterator matching the following
xpath axis. |
Iterator |
getFollowingSiblingAxisIterator(Object contextNode)
Retrieve an
Iterator matching the
following-sibling xpath axis. |
Iterator |
getNamespaceAxisIterator(Object contextNode)
Retrieve an
Iterator matching the namespace
xpath axis. |
String |
getNamespacePrefix(Object ns)
Retrieve the namespace prefix of a namespace node.
|
String |
getNamespaceStringValue(Object ns)
Retrieve the string-value of a namespace node.
|
short |
getNodeType(Object node)
Returns a number that identifies the type of node that the given
object represents in this navigator.
|
Iterator |
getParentAxisIterator(Object contextNode)
Retrieve an
Iterator matching the parent xpath axis. |
Object |
getParentNode(Object contextNode)
Returns the parent of the given context node.
|
Iterator |
getPrecedingAxisIterator(Object contextNode)
Retrieve an
Iterator matching the preceding xpath axis. |
Iterator |
getPrecedingSiblingAxisIterator(Object contextNode)
Retrieve an
Iterator matching the
preceding-sibling xpath axis. |
String |
getProcessingInstructionData(Object pi)
Retrieve the data of a processing-instruction.
|
String |
getProcessingInstructionTarget(Object pi)
Retrieve the target of a processing-instruction.
|
Iterator |
getSelfAxisIterator(Object contextNode)
Retrieve an
Iterator matching the self xpath
axis. |
String |
getTextStringValue(Object txt)
Retrieve the string-value of a text node.
|
boolean |
isAttribute(Object object)
Returns whether the given object is an attribute node.
|
boolean |
isComment(Object object)
Returns whether the given object is a comment node.
|
boolean |
isDocument(Object object)
Returns whether the given object is a document node.
|
boolean |
isElement(Object object)
Returns whether the given object is an element node.
|
boolean |
isNamespace(Object object)
Returns whether the given object is a namespace node.
|
boolean |
isProcessingInstruction(Object object)
Returns whether the given object is a processing-instruction node.
|
boolean |
isText(Object object)
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 documents that use the same navigator as this one.
|
String |
translateNamespacePrefixToUri(String prefix,
Object element)
Translate a namespace prefix to a namespace URI, possibly
considering a particular element node.
|
Iterator getChildAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the child
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getDescendantAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the descendant
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getParentAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the parent xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getAncestorAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the ancestor
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getFollowingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the
following-sibling xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getPrecedingSiblingAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the
preceding-sibling xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getFollowingAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the following
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getPrecedingAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the preceding xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getAttributeAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the attribute
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getNamespaceAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the namespace
xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getSelfAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the self xpath
axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getDescendantOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the
descendant-or-self xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Iterator getAncestorOrSelfAxisIterator(Object contextNode) throws UnsupportedAxisException
Iterator matching the
ancestor-or-self xpath axis.contextNode - The origin context node.UnsupportedAxisException - is the semantics of this axis are
not supported by this object model.Object getDocument(String uri) throws FunctionCallException
uri - is the URI of the document to loadFunctionCallException - if the document could not be loadedObject getDocumentNode(Object contextNode)
object - The context node.isDocument(Object)Object getParentNode(Object contextNode) throws UnsupportedAxisException
The parent of any node must either be a document node or an element node.
object - The context node.UnsupportedAxisExceptionisDocument(java.lang.Object),
isElement(java.lang.Object)String getElementNamespaceUri(Object element)
element - The context element node.String getElementName(Object element)
element - The context element node.String getElementQName(Object element)
element - The context element node.String getAttributeNamespaceUri(Object attr)
element - The context attribute node.String getAttributeName(Object attr)
element - The context attribute node.String getAttributeQName(Object attr)
element - The context attribute node.String getProcessingInstructionTarget(Object pi)
pi - The context processing-instruction node.String getProcessingInstructionData(Object pi)
pi - The context processing-instruction node.boolean isDocument(Object object)
/.object - The object to test.true if the object is a document node,
else falseboolean isElement(Object object)
object - The object to test.true if the object is an element node,
else falseboolean isAttribute(Object object)
object - The object to test.true if the object is an attribute node,
else falseboolean isNamespace(Object object)
object - The object to test.true if the object is a namespace node,
else falseboolean isComment(Object object)
object - The object to test.true if the object is a comment node,
else falseboolean isText(Object object)
object - The object to test.true if the object is a text node,
else falseboolean isProcessingInstruction(Object object)
object - The object to test.true if the object is a processing-instruction node,
else falseString getCommentStringValue(Object comment)
comment - The comment node.String getElementStringValue(Object element)
element - The comment node.String getAttributeStringValue(Object attr)
attr - The attribute node.String getNamespaceStringValue(Object ns)
attr - The namespace node.String getTextStringValue(Object txt)
attr - The text node.String getNamespacePrefix(Object ns)
ns - The namespace node.String translateNamespacePrefixToUri(String prefix, Object element)
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.
prefix - The prefix to translate.element - The element to consider during translation.NamespaceContextXPath parseXPath(String xpath) throws SAXPathException
xpath - The xpath expression.SAXPathExceptionXPathObject getElementById(Object contextNode, String elementId)
contextNode - a node from the document in which to look for the
idelementId - id to look forshort getNodeType(Object node)
org.jaxen.pattern.PatternCopyright © 2013. All Rights Reserved.