Package com.day.cq.search.eval
Class NodenamePredicateEvaluator
- java.lang.Object
-
- com.day.cq.search.eval.AbstractPredicateEvaluator
-
- com.day.cq.search.eval.NodenamePredicateEvaluator
-
- All Implemented Interfaces:
PredicateEvaluator
public class NodenamePredicateEvaluator extends AbstractPredicateEvaluator
Matches on JCR node names.Supports facet extraction. Will provide buckets for each unique node name (filename).
Name:
nodenameProperties:
- nodename
- node name pattern that allows wildcards:
*
= any or no char,?
= any char,[abc]
= only chars in brackets
- case
- option to enable case insensitivity
ignore
= case will be ignored
- Since:
- 5.2
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
CASE
static java.lang.String
CASE_IGNORE
static java.lang.String
NODENAME
-
Constructor Summary
Constructors Constructor Description NodenamePredicateEvaluator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canFilter(Predicate predicate, EvaluationContext context)
Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie.boolean
canXpath(Predicate p, EvaluationContext context)
Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie.FacetExtractor
getFacetExtractor(Predicate predicate, EvaluationContext context)
Default implementation that always returnsnull
, ie.java.lang.String[]
getOrderByProperties(Predicate predicate, EvaluationContext context)
Default implementation that always returnsnull
.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.AbstractPredicateEvaluator
getOrderByComparator, isFiltering
-
-
-
-
Field Detail
-
NODENAME
public static final java.lang.String NODENAME
- See Also:
- Constant Field Values
-
CASE
public static final java.lang.String CASE
- See Also:
- Constant Field Values
-
CASE_IGNORE
public static final java.lang.String CASE_IGNORE
- 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 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 predicate, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Default implementation that always returnsnull
.- Specified by:
getOrderByProperties
in interfacePredicateEvaluator
- Overrides:
getOrderByProperties
in classAbstractPredicateEvaluator
- Parameters:
predicate
- 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
-
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 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:
true
if this row should be part of the final result set,false
if it should be dropped
-
canXpath
public boolean canXpath(Predicate p, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Returns the inverted boolean value of the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not overridden,true
).- Specified by:
canXpath
in interfacePredicateEvaluator
- Overrides:
canXpath
in classAbstractPredicateEvaluator
- Parameters:
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the query evaluation- Returns:
true
if this evaluator can express itself via xpath, ie.PredicateEvaluator.getXPathExpression(Predicate, EvaluationContext)
-
canFilter
public boolean canFilter(Predicate predicate, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Returns the same as the deprecatedAbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not overridden,false
).- Specified by:
canFilter
in interfacePredicateEvaluator
- Overrides:
canFilter
in classAbstractPredicateEvaluator
- Parameters:
predicate
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the query evaluation- Returns:
true
if this evaluator can be express itself via filtering, ie.PredicateEvaluator.includes(Predicate, Row, EvaluationContext)
-
getFacetExtractor
public FacetExtractor getFacetExtractor(Predicate predicate, EvaluationContext context)
Description copied from class:AbstractPredicateEvaluator
Default implementation that always returnsnull
, ie. no facets will be extracted for the predicate.- Specified by:
getFacetExtractor
in interfacePredicateEvaluator
- Overrides:
getFacetExtractor
in 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
FacetExtractor
that is used to create aFacet
ornull
if no extractor shall be provided
-
-