org.jaxen.jdom

Class DocumentNavigator

public class DocumentNavigator extends DefaultNavigator implements NamedAccessNavigator

Interface for navigating around the JDOM object model.

This class is not intended for direct usage, but is used by the Jaxen engine during evaluation.

Author: bob mcwhirter Stephen Colebourne

See Also:

Nested Class Summary
static classDocumentNavigator.Singleton
Singleton implementation.
Field Summary
static longserialVersionUID
Method Summary
IteratorgetAttributeAxisIterator(Object contextNode)
IteratorgetAttributeAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI)
Retrieves an Iterator over the attribute elements that match the supplied name.
StringgetAttributeName(Object obj)
StringgetAttributeNamespaceUri(Object obj)
StringgetAttributeQName(Object obj)
StringgetAttributeStringValue(Object obj)
IteratorgetChildAxisIterator(Object contextNode)
IteratorgetChildAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI)
Retrieves an Iterator over the child elements that match the supplied local name and namespace URI.
StringgetCommentStringValue(Object obj)
ObjectgetDocument(String url)
ObjectgetDocumentNode(Object contextNode)
StringgetElementName(Object obj)
StringgetElementNamespaceUri(Object obj)
StringgetElementQName(Object obj)
StringgetElementStringValue(Object obj)
static NavigatorgetInstance()
IteratorgetNamespaceAxisIterator(Object contextNode)
StringgetNamespacePrefix(Object obj)
StringgetNamespaceStringValue(Object obj)
IteratorgetParentAxisIterator(Object contextNode)
StringgetProcessingInstructionData(Object obj)
StringgetProcessingInstructionTarget(Object obj)
StringgetTextStringValue(Object obj)
booleanisAttribute(Object obj)
booleanisComment(Object obj)
booleanisDocument(Object obj)
booleanisElement(Object obj)
booleanisNamespace(Object obj)
booleanisProcessingInstruction(Object obj)
booleanisText(Object obj)
XPathparseXPath(String xpath)
Returns a parsed form of the given XPath string, which will be suitable for queries on JDOM documents.
StringtranslateNamespacePrefixToUri(String prefix, Object context)

Field Detail

serialVersionUID

private static final long serialVersionUID

Method Detail

getAttributeAxisIterator

public Iterator getAttributeAxisIterator(Object contextNode)

getAttributeAxisIterator

public Iterator getAttributeAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI)
Retrieves an Iterator over the attribute elements that match the supplied name.

Parameters: contextNode the origin context node localName the local name of the attributes to return, always present namespacePrefix the prefix of the namespace of the attributes to return namespaceURI the URI of the namespace of the attributes to return

Returns: an Iterator that traverses the named attributes, not null

getAttributeName

public String getAttributeName(Object obj)

getAttributeNamespaceUri

public String getAttributeNamespaceUri(Object obj)

getAttributeQName

public String getAttributeQName(Object obj)

getAttributeStringValue

public String getAttributeStringValue(Object obj)

getChildAxisIterator

public Iterator getChildAxisIterator(Object contextNode)

getChildAxisIterator

public Iterator getChildAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI)
Retrieves an Iterator over the child elements that match the supplied local name and namespace URI.

Parameters: contextNode the origin context node localName the local name of the children to return, always present namespacePrefix ignored; prefixes are not used when matching in XPath namespaceURI the URI of the namespace of the children to return

Returns: an Iterator that traverses the named children, or null if none

getCommentStringValue

public String getCommentStringValue(Object obj)

getDocument

public Object getDocument(String url)

getDocumentNode

public Object getDocumentNode(Object contextNode)

getElementName

public String getElementName(Object obj)

getElementNamespaceUri

public String getElementNamespaceUri(Object obj)

getElementQName

public String getElementQName(Object obj)

getElementStringValue

public String getElementStringValue(Object obj)

getInstance

public static Navigator getInstance()

getNamespaceAxisIterator

public Iterator getNamespaceAxisIterator(Object contextNode)

getNamespacePrefix

public String getNamespacePrefix(Object obj)

getNamespaceStringValue

public String getNamespaceStringValue(Object obj)

getParentAxisIterator

public Iterator getParentAxisIterator(Object contextNode)

getProcessingInstructionData

public String getProcessingInstructionData(Object obj)

getProcessingInstructionTarget

public String getProcessingInstructionTarget(Object obj)

getTextStringValue

public String getTextStringValue(Object obj)

isAttribute

public boolean isAttribute(Object obj)

isComment

public boolean isComment(Object obj)

isDocument

public boolean isDocument(Object obj)

isElement

public boolean isElement(Object obj)

isNamespace

public boolean isNamespace(Object obj)

isProcessingInstruction

public boolean isProcessingInstruction(Object obj)

isText

public boolean isText(Object obj)

parseXPath

public XPath parseXPath(String xpath)
Returns a parsed form of the given XPath string, which will be suitable for queries on JDOM documents.

translateNamespacePrefixToUri

public String translateNamespacePrefixToUri(String prefix, Object context)