Interface Filter

  • All Known Implementing Classes:
    FilterImpl

    public interface Filter
    The filter for an index lookup that contains a number of restrictions that are combined with AND. Possible restrictions are a property restriction, a path restriction, a node type restriction, and a fulltext restriction.

    A property restriction could be that the property must exist, or that the property value has to be within a certain range.

    A path restriction could be a restriction to a certain subtree, a parent of a certain path, or equality to a certain path.

    • Field Detail

      • EMPTY_FILTER

        static final Filter EMPTY_FILTER
    • Method Detail

      • getPropertyRestrictions

        Collection<Filter.PropertyRestriction> getPropertyRestrictions()
        Get the list of property restrictions, if any. Each property may contain multiple restrictions, for example x=1 and x=2. For this case, only multi-valued properties match that contain both 1 and 2.
        Returns:
        the conditions (an empty collection if not used)
      • getFulltextConditions

        @Deprecated
        Collection<String> getFulltextConditions()
        Deprecated.
        Get the fulltext search conditions, if any.
        Returns:
        the conditions (an empty collection if not used)
      • getFullTextConstraint

        FullTextExpression getFullTextConstraint()
        Get the fulltext search condition expression, if any.
        Returns:
        the condition (null if none)
      • isAccessible

        boolean isAccessible​(String path)
        check whether a certain (valid) path is accessible (can be read) from the user associated with the query Session
        Parameters:
        path - a valid JCR path
        Returns:
        true if path can be read by the calling user, false otherwise.
      • containsNativeConstraint

        boolean containsNativeConstraint()
        Whether the filter contains a native condition.
        Returns:
        true if it does
      • getPropertyRestriction

        Filter.PropertyRestriction getPropertyRestriction​(String propertyName)
        Get the most restrictive property restriction for the given property, if any.
        Parameters:
        propertyName - the property name
        Returns:
        the first restriction, or null if there is no restriction for this property
      • getPropertyRestrictions

        List<Filter.PropertyRestriction> getPropertyRestrictions​(String propertyName)
        Get the all property restriction for the given property.
        Parameters:
        propertyName - the property name
        Returns:
        the list of restrictions (possibly empty, never null)
      • getPathRestriction

        Filter.PathRestriction getPathRestriction()
        Get the path restriction type.
        Returns:
        the path restriction type
      • getPath

        String getPath()
        Get the path, or "/" if there is no path restriction set.
        Returns:
        the path
      • getPathPlan

        String getPathPlan()
        Get the plan for the path.
        Returns:
        the plan
      • getNodeType

        @Nullable
        @Nullable String getNodeType()
        Returns the name of the filter node type.
        Returns:
        nodetype name
      • matchesAllTypes

        boolean matchesAllTypes()
        Checks whether nodes of all types can match this filter.
        Returns:
        true iff there are no type restrictions
      • getSupertypes

        @NotNull
        @NotNull Set<String> getSupertypes()
        Returns the names of the filter node type and all its supertypes.
        Returns:
        supertype name
      • getPrimaryTypes

        @NotNull
        @NotNull Set<String> getPrimaryTypes()
        Returns the names of all matching primary node types.
        Returns:
        primary node type names
      • getMixinTypes

        @NotNull
        @NotNull Set<String> getMixinTypes()
        Returns the names of all matching mixin node types.
        Returns:
        mixin node type names
      • getQueryStatement

        @Nullable
        @Nullable String getQueryStatement()
        Get the complete query statement. The statement should only be used for logging purposes.
        Returns:
        the query statement (possibly null)
      • isAlwaysFalse

        boolean isAlwaysFalse()
        If the filter condition can not possibly match any row, due to a contradiction in the query (for example "x=1 and x=2").
        Returns:
        true if the filter condition can not match any row