Class DocumentNavigator

java.lang.Object
org.jaxen.DefaultNavigator
org.alfresco.repo.search.DocumentNavigator
All Implemented Interfaces:
Serializable, org.jaxen.NamedAccessNavigator, org.jaxen.Navigator

public class DocumentNavigator extends org.jaxen.DefaultNavigator implements org.jaxen.NamedAccessNavigator
An implementation of the Jaxen xpath against the node service API This means any node service can do xpath style navigation. Given any context node we can navigate between nodes using xpath. This allows simple path navigation and much more.
Author:
Andy Hind
See Also:
  • Constructor Details

    • DocumentNavigator

      public DocumentNavigator(DictionaryService dictionaryService, NodeService nodeService, SearchService searchService, NamespacePrefixResolver nspr, boolean followAllParentLinks, boolean useJCRRootNode)
      Deprecated.
      useJCRRootNode parameter is now obsolete.
    • DocumentNavigator

      public DocumentNavigator(DictionaryService dictionaryService, NodeService nodeService, SearchService searchService, NamespacePrefixResolver nspr, boolean followAllParentLinks)
      Parameters:
      dictionaryService - used to resolve the subtypeOf function and other type-related functions
      nodeService - the NodeService against which to execute
      searchService - the service that helps resolve functions such as like and contains
      nspr - resolves namespaces in the xpath
      followAllParentLinks - true if the XPath should traverse all parent associations when going up the hierarchy; false if the only the primary parent-child association should be traversed
  • Method Details

    • getNamespacePrefixResolver

      public NamespacePrefixResolver getNamespacePrefixResolver()
    • setFollowAllParentLinks

      public void setFollowAllParentLinks(boolean followAllParentLinks)
      Allow this to be set as it commonly changes from one search to the next
      Parameters:
      followAllParentLinks - true
    • getAttributeName

      public String getAttributeName(Object o)
      Specified by:
      getAttributeName in interface org.jaxen.Navigator
    • getAttributeNamespaceUri

      public String getAttributeNamespaceUri(Object o)
      Specified by:
      getAttributeNamespaceUri in interface org.jaxen.Navigator
    • getAttributeQName

      public String getAttributeQName(Object o)
      Specified by:
      getAttributeQName in interface org.jaxen.Navigator
    • getAttributeStringValue

      public String getAttributeStringValue(Object o)
      Specified by:
      getAttributeStringValue in interface org.jaxen.Navigator
    • getCommentStringValue

      public String getCommentStringValue(Object o)
      Specified by:
      getCommentStringValue in interface org.jaxen.Navigator
    • getElementName

      public String getElementName(Object o)
      Specified by:
      getElementName in interface org.jaxen.Navigator
    • getElementNamespaceUri

      public String getElementNamespaceUri(Object o)
      Specified by:
      getElementNamespaceUri in interface org.jaxen.Navigator
    • getElementQName

      public String getElementQName(Object o)
      Specified by:
      getElementQName in interface org.jaxen.Navigator
    • getElementStringValue

      public String getElementStringValue(Object o)
      Specified by:
      getElementStringValue in interface org.jaxen.Navigator
    • getNamespacePrefix

      public String getNamespacePrefix(Object o)
      Specified by:
      getNamespacePrefix in interface org.jaxen.Navigator
    • getNamespaceStringValue

      public String getNamespaceStringValue(Object o)
      Specified by:
      getNamespaceStringValue in interface org.jaxen.Navigator
    • getTextStringValue

      public String getTextStringValue(Object o)
      Specified by:
      getTextStringValue in interface org.jaxen.Navigator
    • isAttribute

      public boolean isAttribute(Object o)
      Specified by:
      isAttribute in interface org.jaxen.Navigator
    • isComment

      public boolean isComment(Object o)
      Specified by:
      isComment in interface org.jaxen.Navigator
    • isDocument

      public boolean isDocument(Object o)
      Specified by:
      isDocument in interface org.jaxen.Navigator
    • isElement

      public boolean isElement(Object o)
      Specified by:
      isElement in interface org.jaxen.Navigator
    • isNamespace

      public boolean isNamespace(Object o)
      Specified by:
      isNamespace in interface org.jaxen.Navigator
    • isProcessingInstruction

      public boolean isProcessingInstruction(Object o)
      Specified by:
      isProcessingInstruction in interface org.jaxen.Navigator
    • isText

      public boolean isText(Object o)
      Specified by:
      isText in interface org.jaxen.Navigator
    • parseXPath

      public org.jaxen.XPath parseXPath(String o) throws org.jaxen.JaxenException
      Specified by:
      parseXPath in interface org.jaxen.Navigator
      Throws:
      org.jaxen.JaxenException
    • getAttributeAxisIterator

      public Iterator getAttributeAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getAttributeAxisIterator in interface org.jaxen.NamedAccessNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getAttributeAxisIterator

      public Iterator getAttributeAxisIterator(Object o) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getAttributeAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getAttributeAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getChildAxisIterator

      public Iterator getChildAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getChildAxisIterator in interface org.jaxen.NamedAccessNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getChildAxisIterator

      public Iterator getChildAxisIterator(Object o) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getChildAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getChildAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getFollowingSiblingAxisIterator

      public Iterator getFollowingSiblingAxisIterator(Object arg0) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getFollowingSiblingAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getFollowingSiblingAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
      See Also:
      • always thrown
    • getFollowingAxisIterator

      public Iterator getFollowingAxisIterator(Object arg0) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getFollowingAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getFollowingAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
      See Also:
      • always thrown
    • getPrecedingAxisIterator

      public Iterator getPrecedingAxisIterator(Object arg0) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getPrecedingAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getPrecedingAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
      See Also:
      • always thrown
    • getPrecedingSiblingAxisIterator

      public Iterator getPrecedingSiblingAxisIterator(Object arg0) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getPrecedingSiblingAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getPrecedingSiblingAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
      See Also:
      • always thrown
    • getNamespaceAxisIterator

      public Iterator getNamespaceAxisIterator(Object o) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getNamespaceAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getNamespaceAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getParentAxisIterator

      public Iterator getParentAxisIterator(Object o) throws org.jaxen.UnsupportedAxisException
      Specified by:
      getParentAxisIterator in interface org.jaxen.Navigator
      Overrides:
      getParentAxisIterator in class org.jaxen.DefaultNavigator
      Throws:
      org.jaxen.UnsupportedAxisException
    • getDocumentNode

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

      public Object getNode(NodeRef nodeRef)
    • getNode

      public List<ChildAssociationRef> getNode(NodeRef nodeRef, QNamePattern qNamePattern)
    • like

      public Boolean like(NodeRef childRef, QName qname, String sqlLikePattern, boolean includeFTS)
    • contains

      public Boolean contains(NodeRef childRef, QName qname, String sqlLikePattern, SearchParameters.Operator defaultOperator)
    • isSubtypeOf

      public Boolean isSubtypeOf(NodeRef nodeRef, QName typeQName)
    • hasAspect

      public Boolean hasAspect(NodeRef nodeRef, QName typeQName)