|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Navigator
Interface for navigating around an arbitrary object model, using xpath semantics.
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.
| Method Summary | |
|---|---|
java.util.Iterator |
getAncestorAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the ancestor
xpath axis. |
java.util.Iterator |
getAncestorOrSelfAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the
ancestor-or-self xpath axis. |
java.util.Iterator |
getAttributeAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the attribute
xpath axis. |
java.lang.String |
getAttributeName(java.lang.Object attr)
Retrieve the name of the given attribute node. |
java.lang.String |
getAttributeNamespaceUri(java.lang.Object attr)
Retrieve the namespace URI of the given attribute node. |
java.lang.String |
getAttributeQName(java.lang.Object attr)
Retrieve the QName of the given attribute node. |
java.lang.String |
getAttributeStringValue(java.lang.Object attr)
Retrieve the string-value of an attribute node. |
java.util.Iterator |
getChildAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the child
xpath axis. |
java.lang.String |
getCommentStringValue(java.lang.Object comment)
Retrieve the string-value of a comment node. |
java.util.Iterator |
getDescendantAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the descendant
xpath axis. |
java.util.Iterator |
getDescendantOrSelfAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the
descendant-or-self xpath axis. |
java.lang.Object |
getDocument(java.lang.String uri)
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.Object |
getElementById(java.lang.Object contextNode,
java.lang.String elementId)
Returns the element whose ID is given by elementId. |
java.lang.String |
getElementName(java.lang.Object element)
Retrieve the name of the given element node. |
java.lang.String |
getElementNamespaceUri(java.lang.Object element)
Retrieve the namespace URI of the given element node. |
java.lang.String |
getElementQName(java.lang.Object element)
Retrieve the QName of the given element node. |
java.lang.String |
getElementStringValue(java.lang.Object element)
Retrieve the string-value of an element node. |
java.util.Iterator |
getFollowingAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the following
xpath axis. |
java.util.Iterator |
getFollowingSiblingAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the
following-sibling xpath axis. |
java.util.Iterator |
getNamespaceAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the namespace
xpath axis. |
java.lang.String |
getNamespacePrefix(java.lang.Object ns)
Retrieve the namespace prefix of a namespace node. |
java.lang.String |
getNamespaceStringValue(java.lang.Object ns)
Retrieve the string-value of a namespace node. |
short |
getNodeType(java.lang.Object node)
Returns a number that identifies the type of node that the given object represents in this navigator. |
java.util.Iterator |
getParentAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the parent xpath axis. |
java.lang.Object |
getParentNode(java.lang.Object contextNode)
Returns the parent of the given context node. |
java.util.Iterator |
getPrecedingAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the preceding xpath axis. |
java.util.Iterator |
getPrecedingSiblingAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the
preceding-sibling xpath axis. |
java.lang.String |
getProcessingInstructionData(java.lang.Object pi)
Retrieve the data of a processing-instruction. |
java.lang.String |
getProcessingInstructionTarget(java.lang.Object pi)
Retrieve the target of a processing-instruction. |
java.util.Iterator |
getSelfAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the self xpath
axis. |
java.lang.String |
getTextStringValue(java.lang.Object txt)
Retrieve the string-value of a text node. |
boolean |
isAttribute(java.lang.Object object)
Returns whether the given object is an attribute node. |
boolean |
isComment(java.lang.Object object)
Returns whether the given object is a comment node. |
boolean |
isDocument(java.lang.Object object)
Returns whether the given object is a document node. |
boolean |
isElement(java.lang.Object object)
Returns whether the given object is an element node. |
boolean |
isNamespace(java.lang.Object object)
Returns whether the given object is a namespace node. |
boolean |
isProcessingInstruction(java.lang.Object object)
Returns whether the given object is a processing-instruction node. |
boolean |
isText(java.lang.Object object)
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 documents that use the same navigator as this one. |
java.lang.String |
translateNamespacePrefixToUri(java.lang.String prefix,
java.lang.Object element)
Translate a namespace prefix to a namespace URI, possibly considering a particular element node. |
| Method Detail |
|---|
java.util.Iterator getChildAxisIterator(java.lang.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.
java.util.Iterator getDescendantAxisIterator(java.lang.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.
java.util.Iterator getParentAxisIterator(java.lang.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.
java.util.Iterator getAncestorAxisIterator(java.lang.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.
java.util.Iterator getFollowingSiblingAxisIterator(java.lang.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.
java.util.Iterator getPrecedingSiblingAxisIterator(java.lang.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.
java.util.Iterator getFollowingAxisIterator(java.lang.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.
java.util.Iterator getPrecedingAxisIterator(java.lang.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.
java.util.Iterator getAttributeAxisIterator(java.lang.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.
java.util.Iterator getNamespaceAxisIterator(java.lang.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.
java.util.Iterator getSelfAxisIterator(java.lang.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.
java.util.Iterator getDescendantOrSelfAxisIterator(java.lang.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.
java.util.Iterator getAncestorOrSelfAxisIterator(java.lang.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.
java.lang.Object getDocument(java.lang.String uri)
throws FunctionCallException
uri - is the URI of the document to load
FunctionCallException - if the document could not be loadedjava.lang.Object getDocumentNode(java.lang.Object contextNode)
object - The context node.
isDocument(Object)
java.lang.Object getParentNode(java.lang.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)java.lang.String getElementNamespaceUri(java.lang.Object element)
element - The context element node.
java.lang.String getElementName(java.lang.Object element)
element - The context element node.
java.lang.String getElementQName(java.lang.Object element)
element - The context element node.
java.lang.String getAttributeNamespaceUri(java.lang.Object attr)
element - The context attribute node.
java.lang.String getAttributeName(java.lang.Object attr)
element - The context attribute node.
java.lang.String getAttributeQName(java.lang.Object attr)
element - The context attribute node.
java.lang.String getProcessingInstructionTarget(java.lang.Object pi)
pi - The context processing-instruction node.
java.lang.String getProcessingInstructionData(java.lang.Object pi)
pi - The context processing-instruction node.
boolean isDocument(java.lang.Object object)
/.
object - The object to test.
true if the object is a document node,
else falseboolean isElement(java.lang.Object object)
object - The object to test.
true if the object is an element node,
else falseboolean isAttribute(java.lang.Object object)
object - The object to test.
true if the object is an attribute node,
else falseboolean isNamespace(java.lang.Object object)
object - The object to test.
true if the object is a namespace node,
else falseboolean isComment(java.lang.Object object)
object - The object to test.
true if the object is a comment node,
else falseboolean isText(java.lang.Object object)
object - The object to test.
true if the object is a text node,
else falseboolean isProcessingInstruction(java.lang.Object object)
object - The object to test.
true if the object is a processing-instruction node,
else falsejava.lang.String getCommentStringValue(java.lang.Object comment)
comment - The comment node.
java.lang.String getElementStringValue(java.lang.Object element)
element - The comment node.
java.lang.String getAttributeStringValue(java.lang.Object attr)
attr - The attribute node.
java.lang.String getNamespaceStringValue(java.lang.Object ns)
attr - The namespace node.
java.lang.String getTextStringValue(java.lang.Object txt)
attr - The text node.
java.lang.String getNamespacePrefix(java.lang.Object ns)
ns - The namespace node.
java.lang.String translateNamespacePrefixToUri(java.lang.String prefix,
java.lang.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.
NamespaceContext
XPath parseXPath(java.lang.String xpath)
throws SAXPathException
xpath - The xpath expression.
SAXPathExceptionXPath
java.lang.Object getElementById(java.lang.Object contextNode,
java.lang.String elementId)
contextNode - a node from the document in which to look for the
idelementId - id to look for
short getNodeType(java.lang.Object node)
org.jaxen.pattern.Pattern
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||