|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaxen.DefaultNavigator
org.jaxen.xom.DocumentNavigator
public class DocumentNavigator
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.
XPath
,
Serialized FormConstructor Summary | |
---|---|
DocumentNavigator()
|
Method Summary | |
---|---|
Iterator |
getAttributeAxisIterator(Object o)
Throws UnsupportedAxisException . |
String |
getAttributeName(Object o)
Retrieve the local name of the given attribute node. |
String |
getAttributeNamespaceUri(Object o)
Retrieve the namespace URI of the given attribute node. |
String |
getAttributeQName(Object o)
Retrieve the qualified name of the given attribute node. |
String |
getAttributeStringValue(Object o)
Retrieve the string-value of an attribute node. |
Iterator |
getChildAxisIterator(Object o)
Throws UnsupportedAxisException |
String |
getCommentStringValue(Object o)
Retrieve the string-value of a comment node. |
Object |
getDocument(String s)
Default implementation that always returns null. |
Object |
getDocumentNode(Object o)
Returns the document node that contains the given context node. |
String |
getElementName(Object o)
Retrieve the local name of the given element node. |
String |
getElementNamespaceUri(Object o)
Retrieve the namespace URI of the given element node. |
String |
getElementQName(Object o)
Retrieve the qualified name of the given element node. |
String |
getElementStringValue(Object o)
Retrieve the string-value of an element node. |
Iterator |
getNamespaceAxisIterator(Object o)
Throws UnsupportedAxisException . |
String |
getNamespacePrefix(Object o)
Retrieve the namespace prefix of a namespace node. |
String |
getNamespaceStringValue(Object o)
Retrieve the string-value of a namespace node. |
Iterator |
getParentAxisIterator(Object o)
Throws UnsupportedAxisException |
Object |
getParentNode(Object o)
Default inefficient implementation. |
Iterator |
getPrecedingAxisIterator(Object o)
Retrieve an Iterator matching the preceding XPath axis. |
Iterator |
getPrecedingSiblingAxisIterator(Object o)
Retrieve an Iterator matching the
preceding-sibling XPath axis. |
String |
getProcessingInstructionData(Object o)
Retrieve the data of a processing-instruction. |
String |
getProcessingInstructionTarget(Object o)
Retrieve the target of a processing-instruction. |
String |
getTextStringValue(Object o)
Retrieve the string-value of a text node. |
boolean |
isAttribute(Object o)
Returns whether the given object is an attribute node. |
boolean |
isComment(Object o)
Returns whether the given object is a comment node. |
boolean |
isDocument(Object o)
Returns whether the given object is a document node. |
boolean |
isElement(Object o)
Returns whether the given object is an element node. |
boolean |
isNamespace(Object o)
Returns whether the given object is a namespace node. |
boolean |
isProcessingInstruction(Object o)
Returns whether the given object is a processing-instruction node. |
boolean |
isText(Object o)
Returns whether the given object is a text node. |
XPath |
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. |
String |
translateNamespacePrefixToUri(String s,
Object o)
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, getSelfAxisIterator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DocumentNavigator()
Method Detail |
---|
public boolean isAttribute(Object o)
Navigator
o
- the object to test
true
if the object is an attribute node,
else false
public boolean isComment(Object o)
Navigator
o
- the object to test
true
if the object is a comment node,
else false
public boolean isDocument(Object o)
Navigator
/
.
o
- the object to test
true
if the object is a document node,
else false
public boolean isElement(Object o)
Navigator
o
- the object to test
true
if the object is an element node,
else false
public boolean isNamespace(Object o)
Navigator
o
- the object to test
true
if the object is a namespace node,
else false
public boolean isProcessingInstruction(Object o)
Navigator
o
- the object to test
true
if the object is a processing-instruction node,
else false
public boolean isText(Object o)
Navigator
o
- the object to test
true
if the object is a text node,
else false
public String getAttributeName(Object o)
Navigator
o
- the context attribute node
public String getAttributeNamespaceUri(Object o)
Navigator
o
- the context attribute node
public String getAttributeQName(Object o)
Navigator
o
- the context attribute node
public String getAttributeStringValue(Object o)
Navigator
o
- the attribute node
public String getCommentStringValue(Object o)
Navigator
o
- the comment node
public String getElementName(Object o)
Navigator
o
- the context element node
public String getElementNamespaceUri(Object o)
Navigator
o
- the context element node
public String getElementQName(Object o)
Navigator
o
- the context element node
public String getElementStringValue(Object o)
Navigator
o
- the comment node.
public String getNamespacePrefix(Object o)
Navigator
o
- the namespace node
public String getNamespaceStringValue(Object o)
Navigator
o
- the namespace node
public String getTextStringValue(Object o)
Navigator
o
- the text node
public Object getDocument(String s) throws FunctionCallException
DefaultNavigator
getDocument
in interface Navigator
getDocument
in class DefaultNavigator
s
- the URL of the document to load
FunctionCallException
- if an error occurs while loading the
URL; e.g. an I/O error or the document is malformedpublic Object getDocumentNode(Object o)
Navigator
getDocumentNode
in interface Navigator
getDocumentNode
in class DefaultNavigator
o
- the context node
Navigator.isDocument(Object)
public Iterator getAttributeAxisIterator(Object o)
DefaultNavigator
UnsupportedAxisException
. Subclasses that
support the attribute axis must override this method.
getAttributeAxisIterator
in interface Navigator
getAttributeAxisIterator
in class DefaultNavigator
o
- the original context node
public Iterator getChildAxisIterator(Object o)
DefaultNavigator
UnsupportedAxisException
getChildAxisIterator
in interface Navigator
getChildAxisIterator
in class DefaultNavigator
o
- the original context node
public Iterator getParentAxisIterator(Object o)
DefaultNavigator
UnsupportedAxisException
getParentAxisIterator
in interface Navigator
getParentAxisIterator
in class DefaultNavigator
o
- the original context node
public Object getParentNode(Object o)
DefaultNavigator
getParentNode
in interface Navigator
getParentNode
in class DefaultNavigator
o
- the node whose parent to return
Navigator.isDocument(java.lang.Object)
,
Navigator.isElement(java.lang.Object)
public Iterator getPrecedingAxisIterator(Object o) throws UnsupportedAxisException
Navigator
Iterator
matching the preceding
XPath axis.
getPrecedingAxisIterator
in interface Navigator
getPrecedingAxisIterator
in class DefaultNavigator
o
- the original context node
UnsupportedAxisException
- if the semantics of the preceding axis are
not supported by this object modelpublic Iterator getPrecedingSiblingAxisIterator(Object o) throws UnsupportedAxisException
Navigator
Iterator
matching the
preceding-sibling
XPath axis.
getPrecedingSiblingAxisIterator
in interface Navigator
getPrecedingSiblingAxisIterator
in class DefaultNavigator
o
- the original context node
UnsupportedAxisException
- if the semantics of the preceding-sibling axis are
not supported by this object modelpublic String getProcessingInstructionData(Object o)
Navigator
getProcessingInstructionData
in interface Navigator
getProcessingInstructionData
in class DefaultNavigator
o
- the context processing-instruction node
public String getProcessingInstructionTarget(Object o)
Navigator
getProcessingInstructionTarget
in interface Navigator
getProcessingInstructionTarget
in class DefaultNavigator
o
- the context processing-instruction node
public String translateNamespacePrefixToUri(String s, Object o)
Navigator
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.
translateNamespacePrefixToUri
in interface Navigator
translateNamespacePrefixToUri
in class DefaultNavigator
s
- the prefix to translateo
- the element to consider during translation
NamespaceContext
public XPath parseXPath(String s) throws SAXPathException
Navigator
s
- the XPath expression
SAXPathException
- if the string is not a syntactically
correct XPath expressionXPath
public Iterator getNamespaceAxisIterator(Object o)
DefaultNavigator
UnsupportedAxisException
. Subclasses that
support the namespace axis must override this method.
getNamespaceAxisIterator
in interface Navigator
getNamespaceAxisIterator
in class DefaultNavigator
o
- the original context node
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |