net.sf.swan.xpath.util
Class CompositeNavigator

java.lang.Object
  |
  +--net.sf.swan.xpath.util.CompositeNavigator
All Implemented Interfaces:
org.jaxen.Navigator, java.io.Serializable

public class CompositeNavigator
extends java.lang.Object
implements org.jaxen.Navigator

A Navigator that wraps two other Navigators, dispatching to the appropriate one based on the node type. This permits the use of combined object models with a single Navigator.

See Also:
Serialized Form

Constructor Summary
CompositeNavigator(org.jaxen.Navigator first, org.jaxen.Navigator second)
           
 
Method Summary
 java.util.Iterator getAncestorAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getAncestorOrSelfAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode)
           
 java.lang.String getAttributeName(java.lang.Object attr)
           
 java.lang.String getAttributeNamespaceUri(java.lang.Object attr)
           
 java.lang.String getAttributeQName(java.lang.Object attr)
           
 java.lang.String getAttributeStringValue(java.lang.Object attr)
           
 java.util.Iterator getChildAxisIterator(java.lang.Object contextNode)
           
 java.lang.String getCommentStringValue(java.lang.Object comment)
           
 java.util.Iterator getDescendantAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getDescendantOrSelfAxisIterator(java.lang.Object contextNode)
           
 java.lang.Object getDocument(java.lang.String uri)
           
 java.lang.Object getDocumentNode(java.lang.Object contextNode)
           
 java.lang.Object getElementById(java.lang.Object contextNode, java.lang.String elementId)
           
 java.lang.String getElementName(java.lang.Object element)
           
 java.lang.String getElementNamespaceUri(java.lang.Object element)
           
 java.lang.String getElementQName(java.lang.Object element)
           
 java.lang.String getElementStringValue(java.lang.Object element)
           
 java.util.Iterator getFollowingAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getFollowingSiblingAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getNamespaceAxisIterator(java.lang.Object contextNode)
           
 java.lang.String getNamespacePrefix(java.lang.Object ns)
           
 java.lang.String getNamespaceStringValue(java.lang.Object ns)
           
protected  org.jaxen.Navigator getNavigator(java.lang.Object contextNode, boolean required)
           
 short getNodeType(java.lang.Object node)
           
protected  short getNodeType(java.lang.Object contextNode, org.jaxen.Navigator nav)
           
 java.util.Iterator getParentAxisIterator(java.lang.Object contextNode)
           
 java.lang.Object getParentNode(java.lang.Object contextNode)
           
 java.util.Iterator getPrecedingAxisIterator(java.lang.Object contextNode)
           
 java.util.Iterator getPrecedingSiblingAxisIterator(java.lang.Object contextNode)
           
 java.lang.String getProcessingInstructionData(java.lang.Object pi)
           
 java.lang.String getProcessingInstructionTarget(java.lang.Object pi)
           
 java.util.Iterator getSelfAxisIterator(java.lang.Object contextNode)
           
 java.lang.String getTextStringValue(java.lang.Object txt)
           
 boolean isAttribute(java.lang.Object object)
           
 boolean isComment(java.lang.Object object)
           
 boolean isDocument(java.lang.Object object)
           
 boolean isElement(java.lang.Object object)
           
 boolean isNamespace(java.lang.Object object)
           
 boolean isProcessingInstruction(java.lang.Object object)
           
 boolean isText(java.lang.Object object)
           
 org.jaxen.XPath parseXPath(java.lang.String xpath)
           
 java.lang.String translateNamespacePrefixToUri(java.lang.String prefix, java.lang.Object element)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeNavigator

public CompositeNavigator(org.jaxen.Navigator first,
                          org.jaxen.Navigator second)
Method Detail

getChildAxisIterator

public java.util.Iterator getChildAxisIterator(java.lang.Object contextNode)
                                        throws org.jaxen.UnsupportedAxisException
Specified by:
getChildAxisIterator in interface org.jaxen.Navigator

getDescendantAxisIterator

public java.util.Iterator getDescendantAxisIterator(java.lang.Object contextNode)
                                             throws org.jaxen.UnsupportedAxisException
Specified by:
getDescendantAxisIterator in interface org.jaxen.Navigator

getParentAxisIterator

public java.util.Iterator getParentAxisIterator(java.lang.Object contextNode)
                                         throws org.jaxen.UnsupportedAxisException
Specified by:
getParentAxisIterator in interface org.jaxen.Navigator

getAncestorAxisIterator

public java.util.Iterator getAncestorAxisIterator(java.lang.Object contextNode)
                                           throws org.jaxen.UnsupportedAxisException
Specified by:
getAncestorAxisIterator in interface org.jaxen.Navigator

getFollowingSiblingAxisIterator

public java.util.Iterator getFollowingSiblingAxisIterator(java.lang.Object contextNode)
                                                   throws org.jaxen.UnsupportedAxisException
Specified by:
getFollowingSiblingAxisIterator in interface org.jaxen.Navigator

getPrecedingSiblingAxisIterator

public java.util.Iterator getPrecedingSiblingAxisIterator(java.lang.Object contextNode)
                                                   throws org.jaxen.UnsupportedAxisException
Specified by:
getPrecedingSiblingAxisIterator in interface org.jaxen.Navigator

getFollowingAxisIterator

public java.util.Iterator getFollowingAxisIterator(java.lang.Object contextNode)
                                            throws org.jaxen.UnsupportedAxisException
Specified by:
getFollowingAxisIterator in interface org.jaxen.Navigator

getPrecedingAxisIterator

public java.util.Iterator getPrecedingAxisIterator(java.lang.Object contextNode)
                                            throws org.jaxen.UnsupportedAxisException
Specified by:
getPrecedingAxisIterator in interface org.jaxen.Navigator

getAttributeAxisIterator

public java.util.Iterator getAttributeAxisIterator(java.lang.Object contextNode)
                                            throws org.jaxen.UnsupportedAxisException
Specified by:
getAttributeAxisIterator in interface org.jaxen.Navigator

getNamespaceAxisIterator

public java.util.Iterator getNamespaceAxisIterator(java.lang.Object contextNode)
                                            throws org.jaxen.UnsupportedAxisException
Specified by:
getNamespaceAxisIterator in interface org.jaxen.Navigator

getSelfAxisIterator

public java.util.Iterator getSelfAxisIterator(java.lang.Object contextNode)
                                       throws org.jaxen.UnsupportedAxisException
Specified by:
getSelfAxisIterator in interface org.jaxen.Navigator

getDescendantOrSelfAxisIterator

public java.util.Iterator getDescendantOrSelfAxisIterator(java.lang.Object contextNode)
                                                   throws org.jaxen.UnsupportedAxisException
Specified by:
getDescendantOrSelfAxisIterator in interface org.jaxen.Navigator

getAncestorOrSelfAxisIterator

public java.util.Iterator getAncestorOrSelfAxisIterator(java.lang.Object contextNode)
                                                 throws org.jaxen.UnsupportedAxisException
Specified by:
getAncestorOrSelfAxisIterator in interface org.jaxen.Navigator

getDocument

public java.lang.Object getDocument(java.lang.String uri)
                             throws org.jaxen.FunctionCallException
Specified by:
getDocument in interface org.jaxen.Navigator

getDocumentNode

public java.lang.Object getDocumentNode(java.lang.Object contextNode)
Specified by:
getDocumentNode in interface org.jaxen.Navigator

getParentNode

public java.lang.Object getParentNode(java.lang.Object contextNode)
                               throws org.jaxen.UnsupportedAxisException
Specified by:
getParentNode in interface org.jaxen.Navigator

getElementNamespaceUri

public java.lang.String getElementNamespaceUri(java.lang.Object element)
Specified by:
getElementNamespaceUri in interface org.jaxen.Navigator

getElementName

public java.lang.String getElementName(java.lang.Object element)
Specified by:
getElementName in interface org.jaxen.Navigator

getElementQName

public java.lang.String getElementQName(java.lang.Object element)
Specified by:
getElementQName in interface org.jaxen.Navigator

getAttributeNamespaceUri

public java.lang.String getAttributeNamespaceUri(java.lang.Object attr)
Specified by:
getAttributeNamespaceUri in interface org.jaxen.Navigator

getAttributeName

public java.lang.String getAttributeName(java.lang.Object attr)
Specified by:
getAttributeName in interface org.jaxen.Navigator

getAttributeQName

public java.lang.String getAttributeQName(java.lang.Object attr)
Specified by:
getAttributeQName in interface org.jaxen.Navigator

getProcessingInstructionTarget

public java.lang.String getProcessingInstructionTarget(java.lang.Object pi)
Specified by:
getProcessingInstructionTarget in interface org.jaxen.Navigator

getProcessingInstructionData

public java.lang.String getProcessingInstructionData(java.lang.Object pi)
Specified by:
getProcessingInstructionData in interface org.jaxen.Navigator

isDocument

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

isElement

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

isAttribute

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

isNamespace

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

isComment

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

isText

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

isProcessingInstruction

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

getCommentStringValue

public java.lang.String getCommentStringValue(java.lang.Object comment)
Specified by:
getCommentStringValue in interface org.jaxen.Navigator

getElementStringValue

public java.lang.String getElementStringValue(java.lang.Object element)
Specified by:
getElementStringValue in interface org.jaxen.Navigator

getAttributeStringValue

public java.lang.String getAttributeStringValue(java.lang.Object attr)
Specified by:
getAttributeStringValue in interface org.jaxen.Navigator

getNamespaceStringValue

public java.lang.String getNamespaceStringValue(java.lang.Object ns)
Specified by:
getNamespaceStringValue in interface org.jaxen.Navigator

getTextStringValue

public java.lang.String getTextStringValue(java.lang.Object txt)
Specified by:
getTextStringValue in interface org.jaxen.Navigator

getNamespacePrefix

public java.lang.String getNamespacePrefix(java.lang.Object ns)
Specified by:
getNamespacePrefix in interface org.jaxen.Navigator

translateNamespacePrefixToUri

public java.lang.String translateNamespacePrefixToUri(java.lang.String prefix,
                                                      java.lang.Object element)
Specified by:
translateNamespacePrefixToUri in interface org.jaxen.Navigator

getElementById

public java.lang.Object getElementById(java.lang.Object contextNode,
                                       java.lang.String elementId)
Specified by:
getElementById in interface org.jaxen.Navigator

getNodeType

public short getNodeType(java.lang.Object node)
Specified by:
getNodeType in interface org.jaxen.Navigator

parseXPath

public org.jaxen.XPath parseXPath(java.lang.String xpath)
                           throws org.saxpath.SAXPathException
Specified by:
parseXPath in interface org.jaxen.Navigator

getNavigator

protected org.jaxen.Navigator getNavigator(java.lang.Object contextNode,
                                           boolean required)

getNodeType

protected short getNodeType(java.lang.Object contextNode,
                            org.jaxen.Navigator nav)