com.day.cq.search.eval
Class PredicateGroupEvaluator

java.lang.Object
  extended by com.day.cq.search.eval.AbstractPredicateEvaluator
      extended by com.day.cq.search.eval.PredicateGroupEvaluator
All Implemented Interfaces:
PredicateEvaluator
Direct Known Subclasses:
RootEvaluator

public class PredicateGroupEvaluator
extends AbstractPredicateEvaluator

PredicateGroupEvaluator handles PredicateGroup predicates.

Since:
5.2

Constructor Summary
PredicateGroupEvaluator()
           
 
Method Summary
protected  String getClosingBracket()
           
 FacetExtractor getFacetExtractor(Predicate predicate, EvaluationContext context)
          Default implementation that always returns null, ie.
protected  String getOpeningBracket()
           
 String getXPathExpression(Predicate p, EvaluationContext context)
          Default implementation that always returns null, ie.
 boolean includes(Predicate predicate, Row row, EvaluationContext context)
          Default implementation that always returns true, ie.
 String listFilteringPredicates(PredicateGroup group, EvaluationContext context)
           
 
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, getOrderByProperties, isFiltering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PredicateGroupEvaluator

public PredicateGroupEvaluator()
Method Detail

getOpeningBracket

protected String getOpeningBracket()

getClosingBracket

protected String getClosingBracket()

getXPathExpression

public String getXPathExpression(Predicate p,
                                 EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null, ie. adds nothing to the XPath query. Subclasses can choose whether they want to implement this method or use the AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext) method for advanced filtering (or both).

Specified by:
getXPathExpression in interface PredicateEvaluator
Overrides:
getXPathExpression in class AbstractPredicateEvaluator
Parameters:
p - predicate (for this evaluator type) which is evaluated
context - helper class which provides access to various elements of the query evaluation
Returns:
string containing an XPath predicateEvaluator expression

listFilteringPredicates

public String listFilteringPredicates(PredicateGroup group,
                                      EvaluationContext context)

includes

public boolean includes(Predicate predicate,
                        Row row,
                        EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns true, ie. it does not "touch" the result set at all.

Specified by:
includes in interface PredicateEvaluator
Overrides:
includes in class AbstractPredicateEvaluator
Parameters:
predicate - predicate (for this evaluator type) which is evaluated
row - current row of the result set returned through the xpath query
context - 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

getFacetExtractor

public FacetExtractor getFacetExtractor(Predicate predicate,
                                        EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null, ie. no facets will be extracted for the predicate.

Specified by:
getFacetExtractor in interface PredicateEvaluator
Overrides:
getFacetExtractor in class AbstractPredicateEvaluator
Parameters:
predicate - predicate (for this evaluator type) which is evaluated
context - helper class which provides access to various elements of the query evaluation
Returns:
a FacetExtractor that is used to create a Facet or null if no extractor shall be provided


Copyright © 2009 Day Management AG. All Rights Reserved.