|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.xmlpull.v1.builder.xpath.jaxen.DefaultNavigator
org.xmlpull.v1.builder.xpath.impl.DocumentNavigator
public class DocumentNavigator
Interface for navigating around the XB1 object model to use with Jaxen XPATH implementation.
| Constructor Summary | |
|---|---|
DocumentNavigator()
|
|
| Method Summary | |
|---|---|
java.util.Iterator |
getAttributeAxisIterator(java.lang.Object contextNode)
Throws UnsupportedAxisException |
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)
Throws UnsupportedAxisException |
java.lang.String |
getCommentStringValue(java.lang.Object obj)
Retrieve the string-value of a comment node. |
java.lang.Object |
getDocument(java.lang.String url)
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 DocumentNavigator |
getInstance()
|
java.util.Iterator |
getNamespaceAxisIterator(java.lang.Object contextNode)
Throws UnsupportedAxisException |
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. |
java.util.Iterator |
getParentAxisIterator(java.lang.Object contextNode)
Throws UnsupportedAxisException |
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. |
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 documents that use the same navigator as this one. |
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 org.xmlpull.v1.builder.xpath.jaxen.DefaultNavigator |
|---|
getAncestorAxisIterator, getAncestorOrSelfAxisIterator, getDescendantAxisIterator, getDescendantOrSelfAxisIterator, getElementById, getFollowingAxisIterator, getFollowingSiblingAxisIterator, getNodeType, getParentNode, getPrecedingAxisIterator, getPrecedingSiblingAxisIterator, 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 static DocumentNavigator getInstance()
public boolean isElement(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is an element node,
else falsepublic boolean isComment(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is a comment node,
else falsepublic boolean isText(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is a text node,
else falsepublic boolean isAttribute(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is an attribute node,
else falsepublic boolean isProcessingInstruction(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is a processing-instruction node,
else falsepublic boolean isDocument(java.lang.Object obj)
Navigator/.
obj - The object to test.
true if the object is a document node,
else falsepublic boolean isNamespace(java.lang.Object obj)
Navigator
obj - The object to test.
true if the object is a namespace node,
else falsepublic java.lang.String getElementName(java.lang.Object obj)
Navigator
obj - The context element node.
public java.lang.String getElementNamespaceUri(java.lang.Object obj)
Navigator
obj - The context element node.
public java.lang.String getAttributeName(java.lang.Object obj)
Navigator
public java.lang.String getAttributeNamespaceUri(java.lang.Object obj)
Navigator
public java.util.Iterator getChildAxisIterator(java.lang.Object contextNode)
DefaultNavigatorUnsupportedAxisException
getChildAxisIterator in interface NavigatorgetChildAxisIterator in class DefaultNavigatorcontextNode - The origin context node.
public java.util.Iterator getNamespaceAxisIterator(java.lang.Object contextNode)
DefaultNavigatorUnsupportedAxisException
getNamespaceAxisIterator in interface NavigatorgetNamespaceAxisIterator in class DefaultNavigatorcontextNode - The origin context node.
public java.util.Iterator getParentAxisIterator(java.lang.Object contextNode)
DefaultNavigatorUnsupportedAxisException
getParentAxisIterator in interface NavigatorgetParentAxisIterator in class DefaultNavigatorcontextNode - The origin context node.
public java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode)
DefaultNavigatorUnsupportedAxisException
getAttributeAxisIterator in interface NavigatorgetAttributeAxisIterator in class DefaultNavigatorcontextNode - The origin context node.
public XPath parseXPath(java.lang.String xpath)
throws SAXPathException
Navigator
xpath - The xpath expression.
SAXPathExceptionXPathpublic java.lang.Object getDocumentNode(java.lang.Object contextNode)
Navigator
getDocumentNode in interface NavigatorgetDocumentNode in class DefaultNavigatorNavigator.isDocument(Object)public java.lang.String getElementQName(java.lang.Object obj)
Navigator
obj - The context element node.
public java.lang.String getAttributeQName(java.lang.Object obj)
Navigator
public java.lang.String getNamespaceStringValue(java.lang.Object obj)
Navigator
public java.lang.String getNamespacePrefix(java.lang.Object obj)
Navigator
obj - The namespace node.
public java.lang.String getTextStringValue(java.lang.Object obj)
Navigator
public java.lang.String getAttributeStringValue(java.lang.Object obj)
Navigator
obj - The attribute node.
public java.lang.String getElementStringValue(java.lang.Object obj)
Navigator
obj - The comment node.
public java.lang.String getProcessingInstructionTarget(java.lang.Object obj)
Navigator
getProcessingInstructionTarget in interface NavigatorgetProcessingInstructionTarget in class DefaultNavigatorobj - The context processing-instruction node.
public java.lang.String getProcessingInstructionData(java.lang.Object obj)
Navigator
getProcessingInstructionData in interface NavigatorgetProcessingInstructionData in class DefaultNavigatorobj - The context processing-instruction node.
public java.lang.String getCommentStringValue(java.lang.Object obj)
Navigator
obj - The comment node.
public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix,
java.lang.Object context)
NavigatorStrictly 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 NavigatortranslateNamespacePrefixToUri in class DefaultNavigatorprefix - The prefix to translate.context - The element to consider during translation.
NamespaceContext
public java.lang.Object getDocument(java.lang.String url)
throws FunctionCallException
Navigator
getDocument in interface NavigatorgetDocument in class DefaultNavigatorurl - 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 | ||||||||