Package com.day.cq.search.eval
Class RangePropertyPredicateEvaluator
- java.lang.Object
-
- com.day.cq.search.eval.AbstractPredicateEvaluator
-
- com.day.cq.search.eval.RangePropertyPredicateEvaluator
-
- All Implemented Interfaces:
PredicateEvaluator
- Direct Known Subclasses:
DateRangePredicateEvaluator
public class RangePropertyPredicateEvaluator extends AbstractPredicateEvaluator
Matches a JCR property against an interval. This applies to properties with linear types such as LONG, DOUBLE and DECIMAL. For DATE please see theDateRangePredicateEvaluatorthat has optimized date format input.You can define a lower bound and an upper bound or only one of them. The operation (eg. "lesser than" or "lesser or equals") can also be specified for lower and upper bound individually.
Does not support facet extraction.
Name:
rangepropertyProperties:
- property
- relative path to property
- lowerBound
- lower bound to check property for
- lowerOperation
- ">" (default) or ">=", applies to the lowerValue
- upperBound
- upper bound to check property for
- upperOperation
- "<" (default) or "<=", applies to the lowerValue
- decimal
- "true" if the checked property is of type Decimal
- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringLOWER_BOUNDstatic java.lang.StringLOWER_OPERATIONstatic java.lang.StringPROPERTYstatic java.lang.StringPROPERTY_DECIMALstatic java.lang.StringUPPER_BOUNDstatic java.lang.StringUPPER_OPERATION
-
Constructor Summary
Constructors Constructor Description RangePropertyPredicateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanFilter(Predicate p, EvaluationContext context)Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.booleancanXpath(Predicate p, EvaluationContext context)Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.java.lang.String[]getOrderByProperties(Predicate p, EvaluationContext context)Default implementation that always returnsnull.java.lang.StringgetXPathExpression(Predicate p, EvaluationContext context)Default implementation that always returnsnull, ie.booleanincludes(Predicate p, javax.jcr.query.Row row, EvaluationContext context)Default implementation that always returnstrue, ie.-
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getFacetExtractor, getOrderByComparator, isFiltering
-
-
-
-
Field Detail
-
PROPERTY
public static final java.lang.String PROPERTY
- See Also:
- Constant Field Values
-
LOWER_BOUND
public static final java.lang.String LOWER_BOUND
- See Also:
- Constant Field Values
-
LOWER_OPERATION
public static final java.lang.String LOWER_OPERATION
- See Also:
- Constant Field Values
-
UPPER_BOUND
public static final java.lang.String UPPER_BOUND
- See Also:
- Constant Field Values
-
UPPER_OPERATION
public static final java.lang.String UPPER_OPERATION
- See Also:
- Constant Field Values
-
PROPERTY_DECIMAL
public static final java.lang.String PROPERTY_DECIMAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
getXPathExpression
public java.lang.String getXPathExpression(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluatorDefault 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:
getXPathExpressionin interfacePredicateEvaluator- Overrides:
getXPathExpressionin classAbstractPredicateEvaluator- 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
-
getOrderByProperties
public java.lang.String[] getOrderByProperties(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnsnull.- Specified by:
getOrderByPropertiesin interfacePredicateEvaluator- Overrides:
getOrderByPropertiesin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
- one or multiple relative paths to JCR properties or
null
-
canXpath
public boolean canXpath(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluatorReturns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie. if not overridden,true).- Specified by:
canXpathin interfacePredicateEvaluator- Overrides:
canXpathin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
trueif this evaluator can express itself via xpath, ie.PredicateEvaluator.getXPathExpression(Predicate, EvaluationContext)
-
canFilter
public boolean canFilter(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluatorReturns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie. if not overridden,false).- Specified by:
canFilterin interfacePredicateEvaluator- Overrides:
canFilterin classAbstractPredicateEvaluator- Parameters:
p- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
trueif this evaluator can be express itself via filtering, ie.PredicateEvaluator.includes(Predicate, Row, EvaluationContext)
-
includes
public boolean includes(Predicate p, javax.jcr.query.Row row, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnstrue, ie. it does not "touch" the result set at all.- Specified by:
includesin interfacePredicateEvaluator- Overrides:
includesin classAbstractPredicateEvaluator- 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:
trueif this row should be part of the final result set,falseif it should be dropped
-
-