Package com.day.cq.search.eval
Class JcrBoolPropertyPredicateEvaluator
- java.lang.Object
-
- com.day.cq.search.eval.AbstractPredicateEvaluator
-
- com.day.cq.search.eval.JcrPropertyPredicateEvaluator
-
- com.day.cq.search.eval.JcrBoolPropertyPredicateEvaluator
-
- All Implemented Interfaces:
PredicateEvaluator
public class JcrBoolPropertyPredicateEvaluator extends JcrPropertyPredicateEvaluator
Matches on JCR BOOLEAN properties. Only accepts the values "true" and "false" and in case of "false" it will match if the property has the value "false" or if it does not exist at all. This can be useful for checking for boolean flags that are only set when enabled.The inherited "operation" parameter has no meaning.
Supports facet extraction. Will provide buckets for each true/false value, but only for existing properties.
Name:
boolpropertyProperties:
- boolproperty
- relative path to property, for example
myFeatureEnabled
orjcr:content/myFeatureEnabled
- value
- value to check property for, "true" or "false"
- Since:
- 5.3
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BOOLPROPERTY
-
Fields inherited from class com.day.cq.search.eval.JcrPropertyPredicateEvaluator
AND, DEPTH, MAX_NUMBER_OF_VALUES, OP_EQUALS, OP_EQUALS_IGNORE_CASE, OP_EXISTS, OP_LIKE, OP_NOT, OP_UNEQUALS, OP_UNEQUALS_IGNORE_CASE, OPERATION, PROPERTY, STEP, VALUE
-
-
Constructor Summary
Constructors Constructor Description JcrBoolPropertyPredicateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getXPathExpression(Predicate p, EvaluationContext context)
Default implementation that always returnsnull
, ie.boolean
includes(Predicate p, Row row, EvaluationContext context)
Default implementation that always returnstrue
, ie.-
Methods inherited from class com.day.cq.search.eval.JcrPropertyPredicateEvaluator
canFilter, canXpath, getFacetExtractor, getOrderByProperties
-
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, isFiltering
-
-
-
-
Field Detail
-
BOOLPROPERTY
public static final java.lang.String BOOLPROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
getXPathExpression
public java.lang.String getXPathExpression(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Default implementation that always returnsnull
, ie. adds nothing to the XPath query. Subclasses can choose whether they want to implement this method or use theAbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext)
method for advanced filtering (or both).- Specified by:
getXPathExpression
in interfacePredicateEvaluator
- Overrides:
getXPathExpression
in classJcrPropertyPredicateEvaluator
- Parameters:
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the query evaluation- Returns:
- string containing an XPath predicateEvaluator expression
-
includes
public boolean includes(Predicate p, Row row, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Default implementation that always returnstrue
, ie. it does not "touch" the result set at all.- Specified by:
includes
in interfacePredicateEvaluator
- Overrides:
includes
in classJcrPropertyPredicateEvaluator
- Parameters:
p
- predicate (for this evaluator type) which is evaluatedrow
- current row of the result set returned through the xpath querycontext
- helper class which provides access to various elements of the query evaluation- Returns:
true
if this row should be part of the final result set,false
if it should be dropped
-
-