|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jaxen.DefaultNavigator | +--org.jaxen.jdom.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 url)
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 Navigator |
getInstance()
|
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. |
Iterator |
getParentAxisIterator(Object contextNode)
Throws UnsupportedAxisException |
String |
getProcessingInstructionData(Object obj)
Retrieve the data of a processing-instruction. |
String |
getProcessingInstructionTarget(Object obj)
Retrieve the target of a processing-instruction. |
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 JDOM documents. |
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 Navigator getInstance()
public boolean isElement(Object obj)
Navigator
obj
- The object to test.
true
if the object is an element node,
else false
public boolean isComment(Object obj)
Navigator
obj
- The object to test.
true
if the object is a comment node,
else false
public boolean isText(Object obj)
Navigator
obj
- The object to test.
true
if the object is a text node,
else false
public boolean isAttribute(Object obj)
Navigator
obj
- The object to test.
true
if the object is an attribute node,
else false
public boolean isProcessingInstruction(Object obj)
Navigator
obj
- The object to test.
true
if the object is a processing-instruction node,
else false
public boolean isDocument(Object obj)
Navigator
/
.
obj
- The object to test.
true
if the object is a document node,
else false
public boolean isNamespace(Object obj)
Navigator
obj
- The object to test.
true
if the object is a namespace node,
else false
public String getElementName(Object obj)
Navigator
obj
- The context element node.
public String getElementNamespaceUri(Object obj)
Navigator
obj
- The context element node.
public String getAttributeName(Object obj)
Navigator
obj
- The context attribute node.
public String getAttributeNamespaceUri(Object obj)
Navigator
obj
- The context attribute node.
public Iterator getChildAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getChildAxisIterator
in interface Navigator
getChildAxisIterator
in class DefaultNavigator
contextNode
- The origin context node.
public Iterator getNamespaceAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getNamespaceAxisIterator
in interface Navigator
getNamespaceAxisIterator
in class DefaultNavigator
contextNode
- The origin context node.
public Iterator getParentAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getParentAxisIterator
in interface Navigator
getParentAxisIterator
in class DefaultNavigator
contextNode
- The origin context node.
public Iterator getAttributeAxisIterator(Object contextNode)
DefaultNavigator
UnsupportedAxisException
getAttributeAxisIterator
in interface Navigator
getAttributeAxisIterator
in class DefaultNavigator
contextNode
- The origin context node.
public XPath parseXPath(String xpath) throws SAXPathException
xpath
- The xpath expression.
SAXPathException
- If an error occurs while parsing the
xpath expression.XPath
public Object getDocumentNode(Object contextNode)
Navigator
getDocumentNode
in interface Navigator
getDocumentNode
in class DefaultNavigator
contextNode
- The context node.
Navigator.isDocument(Object)
public String getElementQName(Object obj)
Navigator
obj
- The context element node.
public String getAttributeQName(Object obj)
Navigator
obj
- The context attribute node.
public String getNamespaceStringValue(Object obj)
Navigator
obj
- The namespace node.
public String getNamespacePrefix(Object obj)
Navigator
obj
- The namespace node.
public String getTextStringValue(Object obj)
Navigator
obj
- The text node.
public String getAttributeStringValue(Object obj)
Navigator
obj
- The attribute node.
public String getElementStringValue(Object obj)
Navigator
obj
- The comment node.
public String getProcessingInstructionTarget(Object obj)
Navigator
getProcessingInstructionTarget
in interface Navigator
getProcessingInstructionTarget
in class DefaultNavigator
obj
- The context processing-instruction node.
public String getProcessingInstructionData(Object obj)
Navigator
getProcessingInstructionData
in interface Navigator
getProcessingInstructionData
in class DefaultNavigator
obj
- The context processing-instruction node.
public String getCommentStringValue(Object obj)
Navigator
obj
- 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 interface Navigator
translateNamespacePrefixToUri
in class DefaultNavigator
prefix
- The prefix to translate.context
- The element to consider during translation.
NamespaceContext
public Object getDocument(String url) throws FunctionCallException
Navigator
getDocument
in interface Navigator
getDocument
in class DefaultNavigator
url
- is the URI of the document to load
FunctionCallException
- if the document could not be loaded
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |