Class PropertyInexistenceImpl


  • public class PropertyInexistenceImpl
    extends ConstraintImpl
    A condition to check if the property does not exist ("is null").

    For Jackrabbit 2.x compatibility: if the property is relative (as in "child/propertyName"), then this requires that the given child node exists.

    • Constructor Detail

      • PropertyInexistenceImpl

        public PropertyInexistenceImpl​(SelectorImpl selector,
                                       java.lang.String selectorName,
                                       java.lang.String propertyName)
      • PropertyInexistenceImpl

        public PropertyInexistenceImpl​(java.lang.String selectorName,
                                       java.lang.String propertyName)
    • Method Detail

      • evaluate

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

        public java.util.Set<PropertyExistenceImpl> getPropertyExistenceConditions()
        Description copied from class: ConstraintImpl
        Get the set of property existence conditions that can be derived for this condition. For example, for the condition "x=1 or x=2", the property existence condition is "x is not null". For the condition "x=1 or y=2", there is no such condition. For the condition "x=1 and y=1", there are two (x is not null, and y is not null).
        Specified by:
        getPropertyExistenceConditions in class ConstraintImpl
        Returns:
        the common property existence condition (possibly empty)
      • getSelectors

        public java.util.Set<SelectorImpl> getSelectors()
        Description copied from class: ConstraintImpl
        Get the set of selectors for the given condition.
        Specified by:
        getSelectors in class ConstraintImpl
        Returns:
        the set of selectors (possibly empty)
      • toString

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

        public void bindSelector​(SourceImpl source)
      • restrict

        public void restrict​(FilterImpl f)
        Description copied from class: ConstraintImpl
        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 ConstraintImpl
        Parameters:
        f - the filter
      • restrictPushDown

        public void restrictPushDown​(SelectorImpl s)
        Description copied from class: ConstraintImpl
        Push as much of the condition down to this selector, further restricting the selector condition if possible. This is important for a join: for example, the query "select * from a inner join b on a.x=b.x where a.y=1 and b.y=1", the condition "a.y=1" can be pushed down to "a", and the condition "b.y=1" can be pushed down to "b". That means it is possible to use an index in this case.
        Specified by:
        restrictPushDown in class ConstraintImpl
        Parameters:
        s - the selector
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class ConstraintImpl
      • 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