Interface Filter
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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe path restriction type.static classA restriction for a property. -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhether the filter contains a native condition.Deprecated.Get the fulltext search condition expression, if any.Returns the names of all matching mixin node types.@Nullable StringReturns the name of the filter node type.getPath()Get the path, or "/" if there is no path restriction set.Get the plan for the path.Get the path restriction type.Returns the names of all matching primary node types.getPropertyRestriction(String propertyName) Get the most restrictive property restriction for the given property, if any.Get the list of property restrictions, if any.getPropertyRestrictions(String propertyName) Get the all property restriction for the given property.@Nullable StringGet the complete query statement.Returns the names of the filter node type and all its supertypes.booleanisAccessible(String path) check whether a certain (valid) path is accessible (can be read) from the user associated with the query SessionbooleanIf the filter condition can not possibly match any row, due to a contradiction in the query (for example "x=1 and x=2").default booleanbooleanChecks whether nodes of all types can match this filter.
-
Field Details
-
EMPTY_FILTER
-
-
Method Details
-
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.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)
-
getQueryLimits
QueryLimits getQueryLimits() -
isAccessible
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:
trueif path can be read by the calling user,falseotherwise.
-
containsNativeConstraint
boolean containsNativeConstraint()Whether the filter contains a native condition.- Returns:
- true if it does
-
getPropertyRestriction
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
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
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:
trueiff there are no type restrictions
-
getSupertypes
Returns the names of the filter node type and all its supertypes.- Returns:
- supertype name
-
getPrimaryTypes
Returns the names of all matching primary node types.- Returns:
- primary node type names
-
getMixinTypes
Returns the names of all matching mixin node types.- Returns:
- mixin node type names
-
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
-
isInferenceEnabled
default boolean isInferenceEnabled()- Returns:
- true if inference is enabled.
-