com.day.cq.search.eval
Class TypePredicateEvaluator

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

public class TypePredicateEvaluator
extends AbstractPredicateEvaluator

TypePredicateEvaluator looks for the node type, ie. either primary node type or mixin type. If there is only one type predicate in the query (in a root group which requires all predicates), the XPath element(*, type) function will be used (optimization of the query builder evaluator implementation). Otherwise this will - just as the element() function - search for that node type and all its descendant types to find all nodes for which Node.isNodeType(String) would return true for the given node type name.

Properties:

type
node type or mixin name to check for

Since:
5.2

Field Summary
static String TYPE
           
 
Constructor Summary
TypePredicateEvaluator()
           
 
Method Summary
protected  List<NodeType> getDescendentNodeTypes(NodeType nodeType, NodeTypeManager nodeTypeManager)
           
 FacetExtractor getFacetExtractor(Predicate predicate, EvaluationContext context)
          Default implementation that always returns null, ie.
 String[] getOrderByProperties(Predicate p, EvaluationContext context)
          Default implementation that always returns null.
 String getXPathExpression(Predicate p, EvaluationContext context)
          Default implementation that always returns null, ie.
 
Methods inherited from class com.day.cq.search.eval.AbstractPredicateEvaluator
getOrderByComparator, includes, isFiltering
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

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

TypePredicateEvaluator

public TypePredicateEvaluator()
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

getOrderByProperties

public String[] getOrderByProperties(Predicate p,
                                     EvaluationContext context)
Description copied from class: AbstractPredicateEvaluator
Default implementation that always returns null.

Specified by:
getOrderByProperties in interface PredicateEvaluator
Overrides:
getOrderByProperties 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:
one or multiple relative paths to JCR properties or null

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

getDescendentNodeTypes

protected List<NodeType> getDescendentNodeTypes(NodeType nodeType,
                                                NodeTypeManager nodeTypeManager)
                                         throws RepositoryException
Throws:
RepositoryException


Copyright © 2009 Day Management AG. All Rights Reserved.