|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jaxen.DefaultNavigator | +--org.jaxen.dom4j.DocumentNavigator
Interface for navigating around the EXML 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 contextNode)
Throws UnsupportedAxisException |
String |
getAttributeName(Object obj)
Retrieve the name of the given attribute node. |
String |
getAttributeNamespaceUri(Object obj)
Retrieve the namespace URI of the given attribute node. |
String |
getAttributeQName(Object obj)
Retrieve the QName of the given attribute node. |
String |
getAttributeStringValue(Object obj)
Retrieve the string-value of an attribute node. |
Iterator |
getChildAxisIterator(Object contextNode)
Throws UnsupportedAxisException |
String |
getCommentStringValue(Object obj)
Retrieve the string-value of a comment node. |
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. |
String |
getElementName(Object obj)
Retrieve the name of the given element node. |
String |
getElementNamespaceUri(Object obj)
Retrieve the namespace URI of the given element node. |
String |
getElementQName(Object obj)
Retrieve the QName of the given element node. |
String |
getElementStringValue(Object obj)
Retrieve the string-value of an element node. |
static DocumentNavigator |
getInstance()
Retrieve the singleton instance of this DocumentNavigator . |
Iterator |
getNamespaceAxisIterator(Object contextNode)
Throws UnsupportedAxisException |
String |
getNamespacePrefix(Object obj)
Retrieve the namespace prefix of a namespace node. |
String |
getNamespaceStringValue(Object obj)
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)
Throws UnsupportedAxisException |
Object |
getParentNode(Object contextNode)
Returns the parent of the given context node. |
String |
getProcessingInstructionData(Object obj)
Retrieve the data of a processing-instruction. |
String |
getProcessingInstructionTarget(Object obj)
Retrieve the target of a processing-instruction. |
org.dom4j.io.SAXReader |
getSAXReader()
|
String |
getTextStringValue(Object obj)
Retrieve the string-value of a text node. |
boolean |
isAttribute(Object obj)
Returns whether the given object is an attribute node. |
boolean |
isComment(Object obj)
Returns whether the given object is a comment node. |
boolean |
isDocument(Object obj)
Returns whether the given object is a document node. |
boolean |
isElement(Object obj)
Returns whether the given object is an element node. |
boolean |
isNamespace(Object obj)
Returns whether the given object is a namespace node. |
boolean |
isProcessingInstruction(Object obj)
Returns whether the given object is a processing-instruction node. |
boolean |
isText(Object obj)
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 DOM4J documents. |
void |
setSAXReader(org.dom4j.io.SAXReader reader)
|
String |
translateNamespacePrefixToUri(String prefix,
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 DocumentNavigator getInstance()
DocumentNavigator
.public boolean isElement(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is an element node,
else false
public boolean isComment(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is a comment node,
else false
public boolean isText(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is a text node,
else false
public boolean isAttribute(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is an attribute node,
else false
public boolean isProcessingInstruction(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is a processing-instruction node,
else false
public boolean isDocument(Object obj)
Navigator
/
.org.jaxen.Navigator
object
- The object to test.true
if the object is a document node,
else false
public boolean isNamespace(Object obj)
Navigator
org.jaxen.Navigator
object
- The object to test.true
if the object is a namespace node,
else false
public String getElementName(Object obj)
Navigator
org.jaxen.Navigator
element
- The context element node.public String getElementNamespaceUri(Object obj)
Navigator
org.jaxen.Navigator
element
- The context element node.public String getElementQName(Object obj)
Navigator
org.jaxen.Navigator
element
- The context element node.public String getAttributeName(Object obj)
Navigator
org.jaxen.Navigator
element
- The context attribute node.public String getAttributeNamespaceUri(Object obj)
Navigator
org.jaxen.Navigator
element
- The context attribute node.public String getAttributeQName(Object obj)
Navigator
org.jaxen.Navigator
element
- The context attribute node.public Iterator getChildAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getChildAxisIterator
in class DefaultNavigator
org.jaxen.Navigator
contextNode
- The origin context node.UnsupportedAxisException
- is the semantics of this axis are
not supported by this object model.public Iterator getParentAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getParentAxisIterator
in class DefaultNavigator
org.jaxen.Navigator
contextNode
- The origin context node.UnsupportedAxisException
- is the semantics of this axis are
not supported by this object model.public Iterator getAttributeAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getAttributeAxisIterator
in class DefaultNavigator
org.jaxen.Navigator
contextNode
- The origin context node.UnsupportedAxisException
- is the semantics of this axis are
not supported by this object model.public Iterator getNamespaceAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getNamespaceAxisIterator
in class DefaultNavigator
org.jaxen.Navigator
contextNode
- The origin context node.UnsupportedAxisException
- is the semantics of this axis are
not supported by this object model.public Object getDocumentNode(Object contextNode)
Navigator
getDocumentNode
in class DefaultNavigator
org.jaxen.Navigator
object
- The context node.Navigator.isDocument(Object)
public XPath parseXPath(String xpath) throws org.saxpath.SAXPathException
org.jaxen.Navigator
xpath
- The xpath expression.XPath
public Object getParentNode(Object contextNode)
Navigator
The parent of any node must either be a document node or an element node.
getParentNode
in class DefaultNavigator
org.jaxen.Navigator
object
- The context node.Navigator.isDocument(java.lang.Object)
,
Navigator.isElement(java.lang.Object)
public String getTextStringValue(Object obj)
Navigator
org.jaxen.Navigator
attr
- The text node.public String getElementStringValue(Object obj)
Navigator
org.jaxen.Navigator
element
- The comment node.public String getAttributeStringValue(Object obj)
Navigator
org.jaxen.Navigator
attr
- The attribute node.public String getNamespaceStringValue(Object obj)
Navigator
org.jaxen.Navigator
attr
- The namespace node.public String getNamespacePrefix(Object obj)
Navigator
org.jaxen.Navigator
ns
- The namespace node.public String getCommentStringValue(Object obj)
Navigator
org.jaxen.Navigator
comment
- The comment node.public String translateNamespacePrefixToUri(String prefix, 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 class DefaultNavigator
org.jaxen.Navigator
prefix
- The prefix to translate.element
- The element to consider during translation.NamespaceContext
public short getNodeType(Object node)
Navigator
getNodeType
in class DefaultNavigator
org.jaxen.Navigator
Pattern
public Object getDocument(String uri) throws FunctionCallException
Navigator
getDocument
in class DefaultNavigator
org.jaxen.Navigator
uri
- is the URI of the document to loadFunctionCallException
- if the document could not be loadedpublic String getProcessingInstructionTarget(Object obj)
Navigator
getProcessingInstructionTarget
in class DefaultNavigator
org.jaxen.Navigator
pi
- The context processing-instruction node.public String getProcessingInstructionData(Object obj)
Navigator
getProcessingInstructionData
in class DefaultNavigator
org.jaxen.Navigator
pi
- The context processing-instruction node.public org.dom4j.io.SAXReader getSAXReader()
public void setSAXReader(org.dom4j.io.SAXReader reader)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |