com.day.cq.search.eval
Class NodenamePredicateEvaluator

java.lang.Object
  extended by com.day.cq.search.eval.AbstractPredicateEvaluator
      extended by com.day.cq.search.eval.NodenamePredicateEvaluator
All Implemented Interfaces:
PredicateEvaluator

public class NodenamePredicateEvaluator
extends AbstractPredicateEvaluator

NodenamePredicateEvaluator filters the result set by matching on node names (not possible with xpath query with JCR 1.0).

Properties:

nodename
node name pattern that allows wildcards (*)

Since:
5.2

Field Summary
static String NODENAME
           
 
Constructor Summary
NodenamePredicateEvaluator()
           
 
Method Summary
 Comparator<Row> getOrderByComparator(Predicate predicate, EvaluationContext context)
          Default implementation that always returns null.
 String getXPathExpression(Predicate p, EvaluationContext context)
          Default implementation that always returns null, ie.
 boolean includes(Predicate p, Row row, EvaluationContext context)
          Default implementation that always returns true, ie.
 boolean isFiltering(Predicate p, EvaluationContext context)
          Default implementation that always returns false, because the AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext) also always returns true in this implementation and hence does not filtering at all.
 
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getFacetExtractor, getOrderByProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODENAME

public static final String NODENAME
See Also:
Constant Field Values
Constructor Detail

NodenamePredicateEvaluator

public NodenamePredicateEvaluator()
Method Detail

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

isFiltering

public boolean isFiltering(Predicate p,
                           EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns false, because the AbstractPredicateEvaluator.includes(Predicate, Row, EvaluationContext) also always returns true in this implementation and hence does not filtering at all.

Specified by:
isFiltering in interface PredicateEvaluator
Overrides:
isFiltering 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:
true if this evaluator is filtering the result set for the given predicate

includes

public boolean includes(Predicate p,
                        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:
p - 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

getOrderByComparator

public Comparator<Row> getOrderByComparator(Predicate predicate,
                                            EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null.

Specified by:
getOrderByComparator in interface PredicateEvaluator
Overrides:
getOrderByComparator 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 custom comparator for the given predicate or null


Copyright © 2009 Day Management AG. All Rights Reserved.