|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jaxen.DefaultNavigator
org.jaxen.dom4j.DocumentNavigator
Interface for navigating around the DOM4J 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 | |
java.util.Iterator |
getAttributeAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the attribute
XPath axis. |
java.util.Iterator |
getAttributeAxisIterator(java.lang.Object contextNode,
java.lang.String localName,
java.lang.String namespacePrefix,
java.lang.String namespaceURI)
Retrieves an Iterator over the attribute elements that
match the supplied name. |
java.lang.String |
getAttributeName(java.lang.Object obj)
Retrieve the name of the given attribute node. |
java.lang.String |
getAttributeNamespaceUri(java.lang.Object obj)
Retrieve the namespace URI of the given attribute node. |
java.lang.String |
getAttributeQName(java.lang.Object obj)
Retrieve the QName of the given attribute node. |
java.lang.String |
getAttributeStringValue(java.lang.Object obj)
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.util.Iterator |
getChildAxisIterator(java.lang.Object contextNode,
java.lang.String localName,
java.lang.String namespacePrefix,
java.lang.String namespaceURI)
Retrieves an Iterator over the child elements that
match the supplied name. |
java.lang.String |
getCommentStringValue(java.lang.Object obj)
Retrieve the string-value of a comment node. |
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.String |
getElementName(java.lang.Object obj)
Retrieve the name of the given element node. |
java.lang.String |
getElementNamespaceUri(java.lang.Object obj)
Retrieve the namespace URI of the given element node. |
java.lang.String |
getElementQName(java.lang.Object obj)
Retrieve the QName of the given element node. |
java.lang.String |
getElementStringValue(java.lang.Object obj)
Retrieve the string-value of an element node. |
static Navigator |
getInstance()
Retrieve the singleton instance of this DocumentNavigator . |
java.util.Iterator |
getNamespaceAxisIterator(java.lang.Object contextNode)
Retrieve an Iterator matching the namespace
XPath axis. |
java.lang.String |
getNamespacePrefix(java.lang.Object obj)
Retrieve the namespace prefix of a namespace node. |
java.lang.String |
getNamespaceStringValue(java.lang.Object obj)
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.lang.String |
getProcessingInstructionData(java.lang.Object obj)
Retrieve the data of a processing-instruction. |
java.lang.String |
getProcessingInstructionTarget(java.lang.Object obj)
Retrieve the target of a processing-instruction. |
org.dom4j.io.SAXReader |
getSAXReader()
|
java.lang.String |
getTextStringValue(java.lang.Object obj)
Retrieve the string-value of a text node. |
boolean |
isAttribute(java.lang.Object obj)
Returns whether the given object is an attribute node. |
boolean |
isComment(java.lang.Object obj)
Returns whether the given object is a comment node. |
boolean |
isDocument(java.lang.Object obj)
Returns whether the given object is a document node. |
boolean |
isElement(java.lang.Object obj)
Returns whether the given object is an element node. |
boolean |
isNamespace(java.lang.Object obj)
Returns whether the given object is a namespace node. |
boolean |
isProcessingInstruction(java.lang.Object obj)
Returns whether the given object is a processing-instruction node. |
boolean |
isText(java.lang.Object obj)
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 DOM4J documents. |
void |
setSAXReader(org.dom4j.io.SAXReader reader)
|
java.lang.String |
translateNamespacePrefixToUri(java.lang.String prefix,
java.lang.Object context)
Translate a namespace prefix to a namespace URI, possibly considering a particular element node. |
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 static Navigator getInstance()
DocumentNavigator
.
public boolean isElement(java.lang.Object obj)
Navigator
isElement
in interface Navigator
obj
- the object to test
true
if the object is an element node,
else false
public boolean isComment(java.lang.Object obj)
Navigator
isComment
in interface Navigator
obj
- the object to test
true
if the object is a comment node,
else false
public boolean isText(java.lang.Object obj)
Navigator
isText
in interface Navigator
obj
- the object to test
true
if the object is a text node,
else false
public boolean isAttribute(java.lang.Object obj)
Navigator
isAttribute
in interface Navigator
obj
- the object to test
true
if the object is an attribute node,
else false
public boolean isProcessingInstruction(java.lang.Object obj)
Navigator
isProcessingInstruction
in interface Navigator
obj
- the object to test
true
if the object is a processing-instruction node,
else false
public boolean isDocument(java.lang.Object obj)
Navigator
/
.
isDocument
in interface Navigator
obj
- the object to test
true
if the object is a document node,
else false
public boolean isNamespace(java.lang.Object obj)
Navigator
isNamespace
in interface Navigator
obj
- the object to test
true
if the object is a namespace node,
else false
public java.lang.String getElementName(java.lang.Object obj)
Navigator
getElementName
in interface Navigator
obj
- the context element node
public java.lang.String getElementNamespaceUri(java.lang.Object obj)
Navigator
getElementNamespaceUri
in interface Navigator
obj
- the context element node
public java.lang.String getElementQName(java.lang.Object obj)
Navigator
getElementQName
in interface Navigator
obj
- the context element node
public java.lang.String getAttributeName(java.lang.Object obj)
Navigator
getAttributeName
in interface Navigator
obj
- the context attribute node
public java.lang.String getAttributeNamespaceUri(java.lang.Object obj)
Navigator
getAttributeNamespaceUri
in interface Navigator
obj
- the context attribute node
public java.lang.String getAttributeQName(java.lang.Object obj)
Navigator
getAttributeQName
in interface Navigator
obj
- the context attribute node
public java.util.Iterator getChildAxisIterator(java.lang.Object contextNode)
Navigator
Iterator
matching the child
XPath axis.
getChildAxisIterator
in interface Navigator
getChildAxisIterator
in class DefaultNavigator
contextNode
-
public java.util.Iterator getChildAxisIterator(java.lang.Object contextNode, java.lang.String localName, java.lang.String namespacePrefix, java.lang.String namespaceURI)
Iterator
over the child elements that
match the supplied name.
getChildAxisIterator
in interface NamedAccessNavigator
contextNode
- the origin context nodelocalName
- the local name of the children to return, always presentnamespacePrefix
- the prefix of the namespace of the children to returnnamespaceURI
- the uri of the namespace of the children to return
public java.util.Iterator getParentAxisIterator(java.lang.Object contextNode)
Navigator
Iterator
matching the parent
XPath axis.
getParentAxisIterator
in interface Navigator
getParentAxisIterator
in class DefaultNavigator
contextNode
-
public java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode)
Navigator
Iterator
matching the attribute
XPath axis.
getAttributeAxisIterator
in interface Navigator
getAttributeAxisIterator
in class DefaultNavigator
contextNode
-
public java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode, java.lang.String localName, java.lang.String namespacePrefix, java.lang.String namespaceURI)
Iterator
over the attribute elements that
match the supplied name.
getAttributeAxisIterator
in interface NamedAccessNavigator
contextNode
- the origin context nodelocalName
- the local name of the attributes to return, always presentnamespacePrefix
- the prefix of the namespace of the attributes to returnnamespaceURI
- the URI of the namespace of the attributes to return
public java.util.Iterator getNamespaceAxisIterator(java.lang.Object contextNode)
Navigator
Iterator
matching the namespace
XPath axis.
getNamespaceAxisIterator
in interface Navigator
getNamespaceAxisIterator
in class DefaultNavigator
contextNode
-
public java.lang.Object getDocumentNode(java.lang.Object contextNode)
Navigator
getDocumentNode
in interface Navigator
getDocumentNode
in class DefaultNavigator
public XPath parseXPath(java.lang.String xpath) throws SAXPathException
parseXPath
in interface Navigator
xpath
- the XPath expression
SAXPathException
- if the string is not a syntactically
correct XPath expressionXPath
public java.lang.Object getParentNode(java.lang.Object contextNode)
Navigator
The parent of any node must either be a document node or an element node.
getParentNode
in interface Navigator
getParentNode
in class DefaultNavigator
contextNode
- the node whose parent to return
public java.lang.String getTextStringValue(java.lang.Object obj)
Navigator
getTextStringValue
in interface Navigator
obj
- the text node
public java.lang.String getElementStringValue(java.lang.Object obj)
Navigator
getElementStringValue
in interface Navigator
obj
- the comment node.
public java.lang.String getAttributeStringValue(java.lang.Object obj)
Navigator
getAttributeStringValue
in interface Navigator
obj
- the attribute node
public java.lang.String getNamespaceStringValue(java.lang.Object obj)
Navigator
getNamespaceStringValue
in interface Navigator
obj
- the namespace node
public java.lang.String getNamespacePrefix(java.lang.Object obj)
Navigator
getNamespacePrefix
in interface Navigator
obj
- the namespace node
public java.lang.String getCommentStringValue(java.lang.Object obj)
Navigator
getCommentStringValue
in interface Navigator
obj
- the comment node
public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix, java.lang.Object context)
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
public short getNodeType(java.lang.Object node)
Navigator
getNodeType
in interface Navigator
getNodeType
in class DefaultNavigator
public java.lang.Object getDocument(java.lang.String uri) throws FunctionCallException
Navigator
getDocument
in interface Navigator
getDocument
in class DefaultNavigator
uri
- 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 java.lang.String getProcessingInstructionTarget(java.lang.Object obj)
Navigator
getProcessingInstructionTarget
in interface Navigator
getProcessingInstructionTarget
in class DefaultNavigator
public java.lang.String getProcessingInstructionData(java.lang.Object obj)
Navigator
getProcessingInstructionData
in interface Navigator
getProcessingInstructionData
in class DefaultNavigator
public org.dom4j.io.SAXReader getSAXReader()
public void setSAXReader(org.dom4j.io.SAXReader reader)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |