Class DescendantNodeJoinConditionImpl


  • public class DescendantNodeJoinConditionImpl
    extends JoinConditionImpl
    The "isdescendantnode(...)" join condition.
    • Constructor Summary

      Constructors 
      Constructor Description
      DescendantNodeJoinConditionImpl​(java.lang.String descendantSelectorName, java.lang.String ancestorSelectorName)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bindSelector​(SourceImpl source)  
      boolean canEvaluate​(java.util.Set<SourceImpl> available)
      Whether the join condition can be evaluated if the given selectors are able to retrieve data.
      protected PropertyValue convertValueToType​(PropertyValue v, PropertyValue targetType)  
      org.apache.jackrabbit.oak.query.ast.AstElement copyOf()  
      boolean evaluate()
      Evaluate the result using the currently set values.
      protected java.lang.String getLocalPath​(java.lang.String path)
      Calculate the session local path (the path excluding the workspace name) if possible.
      boolean isParent​(SourceImpl source)
      Check whether the given source is the parent of the join condition, as selector "[b]" is the parent of the join condition "isdescendantnode([a], [b])".
      protected java.lang.String normalizePath​(java.lang.String path)
      Validate and normalize the path.
      protected java.lang.String normalizePropertyName​(java.lang.String propertyName)
      Normalize the property name (including namespace remapping).
      protected java.lang.String protect​(java.lang.Object expression)  
      protected java.lang.String quote​(java.lang.String pathOrName)  
      protected java.lang.String quoteJson​(java.lang.String string)  
      void restrict​(FilterImpl f)
      Apply the condition to the filter, further restricting the filter if possible.
      void restrictPushDown​(SelectorImpl s)
      Push as much of the condition down to this selector, further restricting the selector condition if possible.
      void setQuery​(QueryImpl query)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DescendantNodeJoinConditionImpl

        public DescendantNodeJoinConditionImpl​(java.lang.String descendantSelectorName,
                                               java.lang.String ancestorSelectorName)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • bindSelector

        public void bindSelector​(SourceImpl source)
      • evaluate

        public boolean evaluate()
        Description copied from class: JoinConditionImpl
        Evaluate the result using the currently set values.
        Specified by:
        evaluate in class JoinConditionImpl
        Returns:
        true if the constraint matches
      • restrict

        public void restrict​(FilterImpl f)
        Description copied from class: JoinConditionImpl
        Apply the condition to the filter, further restricting the filter if possible. This may also verify the data types are compatible, and that paths are valid.
        Specified by:
        restrict in class JoinConditionImpl
        Parameters:
        f - the filter
      • restrictPushDown

        public void restrictPushDown​(SelectorImpl s)
        Description copied from class: JoinConditionImpl
        Push as much of the condition down to this selector, further restricting the selector condition if possible.
        Specified by:
        restrictPushDown in class JoinConditionImpl
        Parameters:
        s - the selector
      • isParent

        public boolean isParent​(SourceImpl source)
        Description copied from class: JoinConditionImpl
        Check whether the given source is the parent of the join condition, as selector "[b]" is the parent of the join condition "isdescendantnode([a], [b])".
        Specified by:
        isParent in class JoinConditionImpl
        Parameters:
        source - the source
        Returns:
        true if the source is the parent
      • canEvaluate

        public boolean canEvaluate​(java.util.Set<SourceImpl> available)
        Description copied from class: JoinConditionImpl
        Whether the join condition can be evaluated if the given selectors are able to retrieve data.
        Specified by:
        canEvaluate in class JoinConditionImpl
        Parameters:
        available - the available selectors
        Returns:
        true if the condition can be evaluated
      • copyOf

        public org.apache.jackrabbit.oak.query.ast.AstElement copyOf()
        Returns:
        a clone of self. Default implementation in AstElement returns same reference to this.
      • protect

        protected java.lang.String protect​(java.lang.Object expression)
      • quote

        protected java.lang.String quote​(java.lang.String pathOrName)
      • quoteJson

        protected java.lang.String quoteJson​(java.lang.String string)
      • setQuery

        public void setQuery​(QueryImpl query)
      • normalizePropertyName

        protected java.lang.String normalizePropertyName​(java.lang.String propertyName)
        Normalize the property name (including namespace remapping). Asterisks are kept.
        Parameters:
        propertyName - the property name to normalize
        Returns:
        the normalized (oak-) property name
      • normalizePath

        protected java.lang.String normalizePath​(java.lang.String path)
        Validate and normalize the path.
        Parameters:
        path - the path to validate
        Returns:
        the validated and normalized path
      • getLocalPath

        protected java.lang.String getLocalPath​(java.lang.String path)
        Calculate the session local path (the path excluding the workspace name) if possible.
        Parameters:
        path - the absolute path
        Returns:
        the session local path, or null if not within this workspace