public class DocumentNavigator extends DefaultNavigator
| Constructor and Description |
|---|
DocumentNavigator() |
| Modifier and Type | Method and Description |
|---|---|
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 DocumentNavigator |
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 documents that use the same navigator as this one.
|
String |
translateNamespacePrefixToUri(String prefix,
Object context)
Translate a namespace prefix to a namespace URI, possibly
considering a particular element node.
|
getAncestorAxisIterator, getAncestorOrSelfAxisIterator, getDescendantAxisIterator, getDescendantOrSelfAxisIterator, getElementById, getFollowingAxisIterator, getFollowingSiblingAxisIterator, getNodeType, getParentNode, getPrecedingAxisIterator, getPrecedingSiblingAxisIterator, getSelfAxisIteratorpublic static DocumentNavigator getInstance()
public boolean isElement(Object obj)
Navigatorobj - The object to test.true if the object is an element node,
else falsepublic boolean isComment(Object obj)
Navigatorobj - The object to test.true if the object is a comment node,
else falsepublic boolean isText(Object obj)
Navigatorobj - The object to test.true if the object is a text node,
else falsepublic boolean isAttribute(Object obj)
Navigatorobj - The object to test.true if the object is an attribute node,
else falsepublic boolean isProcessingInstruction(Object obj)
Navigatorobj - The object to test.true if the object is a processing-instruction node,
else falsepublic boolean isDocument(Object obj)
Navigator/.obj - The object to test.true if the object is a document node,
else falsepublic boolean isNamespace(Object obj)
Navigatorobj - The object to test.true if the object is a namespace node,
else falsepublic String getElementName(Object obj)
Navigatorobj - The context element node.public String getElementNamespaceUri(Object obj)
Navigatorobj - The context element node.public String getAttributeName(Object obj)
Navigatorpublic String getAttributeNamespaceUri(Object obj)
Navigatorpublic Iterator getChildAxisIterator(Object contextNode)
DefaultNavigatorUnsupportedAxisExceptiongetChildAxisIterator in interface NavigatorgetChildAxisIterator in class DefaultNavigatorcontextNode - The origin context node.public Iterator getNamespaceAxisIterator(Object contextNode)
DefaultNavigatorUnsupportedAxisExceptiongetNamespaceAxisIterator in interface NavigatorgetNamespaceAxisIterator in class DefaultNavigatorcontextNode - The origin context node.public Iterator getParentAxisIterator(Object contextNode)
DefaultNavigatorUnsupportedAxisExceptiongetParentAxisIterator in interface NavigatorgetParentAxisIterator in class DefaultNavigatorcontextNode - The origin context node.public Iterator getAttributeAxisIterator(Object contextNode)
DefaultNavigatorUnsupportedAxisExceptiongetAttributeAxisIterator in interface NavigatorgetAttributeAxisIterator in class DefaultNavigatorcontextNode - The origin context node.public XPath parseXPath(String xpath) throws SAXPathException
Navigatorxpath - The xpath expression.SAXPathExceptionXPathpublic Object getDocumentNode(Object contextNode)
NavigatorgetDocumentNode in interface NavigatorgetDocumentNode in class DefaultNavigatorNavigator.isDocument(Object)public String getElementQName(Object obj)
Navigatorobj - The context element node.public String getAttributeQName(Object obj)
Navigatorpublic String getNamespaceStringValue(Object obj)
Navigatorpublic String getNamespacePrefix(Object obj)
Navigatorobj - The namespace node.public String getTextStringValue(Object obj)
Navigatorpublic String getAttributeStringValue(Object obj)
Navigatorobj - The attribute node.public String getElementStringValue(Object obj)
Navigatorobj - The comment node.public String getProcessingInstructionTarget(Object obj)
NavigatorgetProcessingInstructionTarget in interface NavigatorgetProcessingInstructionTarget in class DefaultNavigatorobj - The context processing-instruction node.public String getProcessingInstructionData(Object obj)
NavigatorgetProcessingInstructionData in interface NavigatorgetProcessingInstructionData in class DefaultNavigatorobj - The context processing-instruction node.public String getCommentStringValue(Object obj)
Navigatorobj - The comment node.public String translateNamespacePrefixToUri(String prefix, 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.NamespaceContextpublic Object getDocument(String url) throws FunctionCallException
NavigatorgetDocument in interface NavigatorgetDocument in class DefaultNavigatorurl - is the URI of the document to loadFunctionCallException - if the document could not be loadedCopyright © 2013. All Rights Reserved.