org.cdmckay.coffeedom.xpath.jaxen
Class DocumentNavigator

java.lang.Object
  extended by org.jaxen.DefaultNavigator
      extended by org.cdmckay.coffeedom.xpath.jaxen.DocumentNavigator
All Implemented Interfaces:
Serializable, org.jaxen.NamedAccessNavigator, org.jaxen.Navigator

public class DocumentNavigator
extends org.jaxen.DefaultNavigator
implements org.jaxen.NamedAccessNavigator

Interface for navigating around the CoffeeDOM object model.

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

Author:
Bob McWhirter, Stephen Colebourne, Cameron McKay
See Also:
XPath, Serialized Form

Constructor Summary
DocumentNavigator()
           
 
Method Summary
 Iterator getAttributeAxisIterator(Object contextNode)
           
 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 object)
           
 String getAttributeNamespaceUri(Object object)
           
 String getAttributeQName(Object object)
           
 String getAttributeStringValue(Object object)
           
 Iterator getChildAxisIterator(Object contextNode)
           
 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.
 String getCommentStringValue(Object obj)
           
 Object getDocument(String url)
           
 Object getDocumentNode(Object contextNode)
           
 String getElementName(Object object)
           
 String getElementNamespaceUri(Object object)
           
 String getElementQName(Object object)
           
 String getElementStringValue(Object object)
           
static org.jaxen.Navigator getInstance()
           
 Iterator getNamespaceAxisIterator(Object contextNode)
           
 String getNamespacePrefix(Object object)
           
 String getNamespaceStringValue(Object object)
           
 Iterator getParentAxisIterator(Object contextNode)
           
 String getProcessingInstructionData(Object obj)
           
 String getProcessingInstructionTarget(Object obj)
           
 String getTextStringValue(Object object)
           
 boolean isAttribute(Object object)
           
 boolean isComment(Object object)
           
 boolean isDocument(Object object)
           
 boolean isElement(Object object)
           
 boolean isNamespace(Object object)
           
 boolean isProcessingInstruction(Object object)
           
 boolean isText(Object object)
           
 org.jaxen.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)
           
 
Methods inherited from class org.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
 
Methods inherited from interface org.jaxen.Navigator
getAncestorAxisIterator, getAncestorOrSelfAxisIterator, getDescendantAxisIterator, getDescendantOrSelfAxisIterator, getElementById, getFollowingAxisIterator, getFollowingSiblingAxisIterator, getNodeType, getParentNode, getPrecedingAxisIterator, getPrecedingSiblingAxisIterator, getSelfAxisIterator
 

Constructor Detail

DocumentNavigator

public DocumentNavigator()
Method Detail

getInstance

public static org.jaxen.Navigator getInstance()

isElement

public boolean isElement(Object object)
Specified by:
isElement in interface org.jaxen.Navigator

isComment

public boolean isComment(Object object)
Specified by:
isComment in interface org.jaxen.Navigator

isText

public boolean isText(Object object)
Specified by:
isText in interface org.jaxen.Navigator

isAttribute

public boolean isAttribute(Object object)
Specified by:
isAttribute in interface org.jaxen.Navigator

isProcessingInstruction

public boolean isProcessingInstruction(Object object)
Specified by:
isProcessingInstruction in interface org.jaxen.Navigator

isDocument

public boolean isDocument(Object object)
Specified by:
isDocument in interface org.jaxen.Navigator

isNamespace

public boolean isNamespace(Object object)
Specified by:
isNamespace in interface org.jaxen.Navigator

getElementName

public String getElementName(Object object)
Specified by:
getElementName in interface org.jaxen.Navigator

getElementNamespaceUri

public String getElementNamespaceUri(Object object)
Specified by:
getElementNamespaceUri in interface org.jaxen.Navigator

getAttributeName

public String getAttributeName(Object object)
Specified by:
getAttributeName in interface org.jaxen.Navigator

getAttributeNamespaceUri

public String getAttributeNamespaceUri(Object object)
Specified by:
getAttributeNamespaceUri in interface org.jaxen.Navigator

getChildAxisIterator

public Iterator getChildAxisIterator(Object contextNode)
Specified by:
getChildAxisIterator in interface org.jaxen.Navigator
Overrides:
getChildAxisIterator in class org.jaxen.DefaultNavigator

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.

Specified by:
getChildAxisIterator in interface org.jaxen.NamedAccessNavigator
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

getNamespaceAxisIterator

public Iterator getNamespaceAxisIterator(Object contextNode)
Specified by:
getNamespaceAxisIterator in interface org.jaxen.Navigator
Overrides:
getNamespaceAxisIterator in class org.jaxen.DefaultNavigator

getParentAxisIterator

public Iterator getParentAxisIterator(Object contextNode)
Specified by:
getParentAxisIterator in interface org.jaxen.Navigator
Overrides:
getParentAxisIterator in class org.jaxen.DefaultNavigator

getAttributeAxisIterator

public Iterator getAttributeAxisIterator(Object contextNode)
Specified by:
getAttributeAxisIterator in interface org.jaxen.Navigator
Overrides:
getAttributeAxisIterator in class org.jaxen.DefaultNavigator

getAttributeAxisIterator

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

Specified by:
getAttributeAxisIterator in interface org.jaxen.NamedAccessNavigator
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

parseXPath

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

Specified by:
parseXPath in interface org.jaxen.Navigator
Throws:
org.jaxen.saxpath.SAXPathException

getDocumentNode

public Object getDocumentNode(Object contextNode)
Specified by:
getDocumentNode in interface org.jaxen.Navigator
Overrides:
getDocumentNode in class org.jaxen.DefaultNavigator

getElementQName

public String getElementQName(Object object)
Specified by:
getElementQName in interface org.jaxen.Navigator

getAttributeQName

public String getAttributeQName(Object object)
Specified by:
getAttributeQName in interface org.jaxen.Navigator

getNamespaceStringValue

public String getNamespaceStringValue(Object object)
Specified by:
getNamespaceStringValue in interface org.jaxen.Navigator

getNamespacePrefix

public String getNamespacePrefix(Object object)
Specified by:
getNamespacePrefix in interface org.jaxen.Navigator

getTextStringValue

public String getTextStringValue(Object object)
Specified by:
getTextStringValue in interface org.jaxen.Navigator

getAttributeStringValue

public String getAttributeStringValue(Object object)
Specified by:
getAttributeStringValue in interface org.jaxen.Navigator

getElementStringValue

public String getElementStringValue(Object object)
Specified by:
getElementStringValue in interface org.jaxen.Navigator

getProcessingInstructionTarget

public String getProcessingInstructionTarget(Object obj)
Specified by:
getProcessingInstructionTarget in interface org.jaxen.Navigator
Overrides:
getProcessingInstructionTarget in class org.jaxen.DefaultNavigator

getProcessingInstructionData

public String getProcessingInstructionData(Object obj)
Specified by:
getProcessingInstructionData in interface org.jaxen.Navigator
Overrides:
getProcessingInstructionData in class org.jaxen.DefaultNavigator

getCommentStringValue

public String getCommentStringValue(Object obj)
Specified by:
getCommentStringValue in interface org.jaxen.Navigator

translateNamespacePrefixToUri

public String translateNamespacePrefixToUri(String prefix,
                                            Object context)
Specified by:
translateNamespacePrefixToUri in interface org.jaxen.Navigator
Overrides:
translateNamespacePrefixToUri in class org.jaxen.DefaultNavigator

getDocument

public Object getDocument(String url)
                   throws org.jaxen.FunctionCallException
Specified by:
getDocument in interface org.jaxen.Navigator
Overrides:
getDocument in class org.jaxen.DefaultNavigator
Throws:
org.jaxen.FunctionCallException


Copyright © 2011. All Rights Reserved.