|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jaxen.DefaultNavigator
org.jaxen.javabean.DocumentNavigator
Interface for navigating around a JavaBean object model.
This class is not intended for direct usage, but is used by the Jaxen engine during evaluation.
XPath,
Serialized Form| Constructor Summary | |
DocumentNavigator()
|
|
| Method Summary | |
Iterator |
getAttributeAxisIterator(Object contextNode)
Retrieve an Iterator matching the attribute
XPath axis. |
Iterator |
getAttributeAxisIterator(Object contextNode,
String localName,
String namespacePrefix,
String namespaceURI)
Retrieves an Iterator over the attribute elements that
match the supplied name. |
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)
Retrieve an Iterator matching the child
XPath axis. |
Iterator |
getChildAxisIterator(Object contextNode,
String localName,
String namespacePrefix,
String namespaceURI)
Retrieves an Iterator over the child elements that
match the supplied name. |
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 Navigator |
getInstance()
Retrieve the singleton instance of this DocumentNavigator. |
Iterator |
getNamespaceAxisIterator(Object contextNode)
Retrieve an Iterator matching the namespace
XPath axis. |
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)
Retrieve an Iterator matching the parent XPath axis. |
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. |
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. |
protected String |
javacase(String name)
|
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. |
| 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(Object obj)
Navigator
isElement in interface Navigatorobj - the object to test
true if the object is an element node,
else falsepublic boolean isComment(Object obj)
Navigator
isComment in interface Navigatorobj - the object to test
true if the object is a comment node,
else falsepublic boolean isText(Object obj)
Navigator
isText in interface Navigatorobj - the object to test
true if the object is a text node,
else falsepublic boolean isAttribute(Object obj)
Navigator
isAttribute in interface Navigatorobj - the object to test
true if the object is an attribute node,
else falsepublic boolean isProcessingInstruction(Object obj)
Navigator
isProcessingInstruction in interface Navigatorobj - the object to test
true if the object is a processing-instruction node,
else falsepublic boolean isDocument(Object obj)
Navigator/.
isDocument in interface Navigatorobj - the object to test
true if the object is a document node,
else falsepublic boolean isNamespace(Object obj)
Navigator
isNamespace in interface Navigatorobj - the object to test
true if the object is a namespace node,
else falsepublic String getElementName(Object obj)
Navigator
getElementName in interface Navigatorobj - the context element node
public String getElementNamespaceUri(Object obj)
Navigator
getElementNamespaceUri in interface Navigatorobj - the context element node
public String getElementQName(Object obj)
Navigator
getElementQName in interface Navigatorobj - the context element node
public String getAttributeName(Object obj)
Navigator
getAttributeName in interface Navigatorobj - the context attribute node
public String getAttributeNamespaceUri(Object obj)
Navigator
getAttributeNamespaceUri in interface Navigatorobj - the context attribute node
public String getAttributeQName(Object obj)
Navigator
getAttributeQName in interface Navigatorobj - the context attribute node
public Iterator getChildAxisIterator(Object contextNode)
NavigatorIterator matching the child
XPath axis.
getChildAxisIterator in interface NavigatorgetChildAxisIterator in class DefaultNavigatorcontextNode -
public Iterator getChildAxisIterator(Object contextNode,
String localName,
String namespacePrefix,
String namespaceURI)
Iterator over the child elements that
match the supplied name.
getChildAxisIterator in interface NamedAccessNavigatorcontextNode - 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 namespace URI of the children to return
public Iterator getParentAxisIterator(Object contextNode)
NavigatorIterator matching the parent XPath axis.
getParentAxisIterator in interface NavigatorgetParentAxisIterator in class DefaultNavigatorcontextNode -
public Iterator getAttributeAxisIterator(Object contextNode)
NavigatorIterator matching the attribute
XPath axis.
getAttributeAxisIterator in interface NavigatorgetAttributeAxisIterator in class DefaultNavigatorcontextNode -
public Iterator getAttributeAxisIterator(Object contextNode,
String localName,
String namespacePrefix,
String namespaceURI)
Iterator over the attribute elements that
match the supplied name.
getAttributeAxisIterator in interface NamedAccessNavigatorcontextNode - 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 namespace URI of the attributes to return
public Iterator getNamespaceAxisIterator(Object contextNode)
NavigatorIterator matching the namespace
XPath axis.
getNamespaceAxisIterator in interface NavigatorgetNamespaceAxisIterator in class DefaultNavigatorcontextNode -
public Object getDocumentNode(Object contextNode)
Navigator
getDocumentNode in interface NavigatorgetDocumentNode in class DefaultNavigatorpublic Object getParentNode(Object contextNode)
NavigatorThe parent of any node must either be a document node or an element node.
getParentNode in interface NavigatorgetParentNode in class DefaultNavigatorcontextNode - the node whose parent to return
public String getTextStringValue(Object obj)
Navigator
getTextStringValue in interface Navigatorobj - the text node
public String getElementStringValue(Object obj)
Navigator
getElementStringValue in interface Navigatorobj - the comment node.
public String getAttributeStringValue(Object obj)
Navigator
getAttributeStringValue in interface Navigatorobj - the attribute node
public String getNamespaceStringValue(Object obj)
Navigator
getNamespaceStringValue in interface Navigatorobj - the namespace node
public String getNamespacePrefix(Object obj)
Navigator
getNamespacePrefix in interface Navigatorobj - the namespace node
public String getCommentStringValue(Object obj)
Navigator
getCommentStringValue in interface 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 DefaultNavigatorpublic short getNodeType(Object node)
Navigator
getNodeType in interface NavigatorgetNodeType in class DefaultNavigator
public Object getDocument(String uri)
throws FunctionCallException
Navigator
getDocument in interface NavigatorgetDocument in class DefaultNavigatoruri - 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 String getProcessingInstructionTarget(Object obj)
Navigator
getProcessingInstructionTarget in interface NavigatorgetProcessingInstructionTarget in class DefaultNavigatorpublic String getProcessingInstructionData(Object obj)
Navigator
getProcessingInstructionData in interface NavigatorgetProcessingInstructionData in class DefaultNavigator
public XPath parseXPath(String xpath)
throws SAXPathException
Navigator
parseXPath in interface Navigatorxpath - the XPath expression
SAXPathException - if the string is not a syntactically
correct XPath expressionXPathprotected String javacase(String name)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||