Package com.day.cq.search.eval
Class PathPredicateEvaluator
java.lang.Object
com.day.cq.search.eval.AbstractPredicateEvaluator
com.day.cq.search.eval.PathPredicateEvaluator
- All Implemented Interfaces:
PredicateEvaluator
Searches within a given path.
Does not support facet extraction.
Name:
pathProperties:
- path
- path pattern; depending on
exact, either the entire subtree will match (like appending //* in xpath, but note that this does not include the base path) (exact=false, default) or only an exact path matches, which can include wildcards (*); ifselfis set, the entire subtree including the base node will be searched - exact
- if exact is true/on, the exact path must match, but it can contain simple wildcards (*), that match names, but not "/"; if it is false (default) all descendents are included (optional)
- flat
- searches only the direct children (like appending "/*" in xpath) (only used if 'exact' is not true, optional)
- self
- searches the subtree but includes the base node given as path (no wildcards)
- Since:
- 5.2
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancanFilter(Predicate predicate, EvaluationContext context) Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.booleancanXpath(Predicate predicate, EvaluationContext context) Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)method (ie.static StringEncodes absolute paths, but keeps wildcards in case this is an "exact" query containing wildcards.getOrderByComparator(Predicate predicate, EvaluationContext context) Default implementation that always returnsnull.getXPathExpression(Predicate p, EvaluationContext context) Default implementation that always returnsnull, ie.booleanincludes(Predicate p, Row row, EvaluationContext context) Default implementation that always returnstrue, ie.Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getFacetExtractor, getOrderByProperties, isFiltering
-
Field Details
-
PATH
- See Also:
-
EXACT
- See Also:
-
FLAT
- See Also:
-
SELF
- See Also:
-
-
Constructor Details
-
PathPredicateEvaluator
public PathPredicateEvaluator()
-
-
Method Details
-
encodePath
Encodes absolute paths, but keeps wildcards in case this is an "exact" query containing wildcards. -
getXPathExpression
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
-
includes
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
-
getOrderByComparator
Description copied from class:AbstractPredicateEvaluatorDefault implementation that always returnsnull.- Specified by:
getOrderByComparatorin interfacePredicateEvaluator- Overrides:
getOrderByComparatorin classAbstractPredicateEvaluator- Parameters:
predicate- predicate (for this evaluator type) which is evaluatedcontext- helper class which provides access to various elements of the query evaluation- Returns:
- a custom comparator for the given predicate or
null
-
canXpath
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:
predicate- 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
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:
predicate- 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)
-