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.
Constructor and Description |
---|
TypePredicateEvaluator() |
Modifier and Type | Method and Description |
---|---|
boolean |
canFilter(Predicate p,
EvaluationContext context)
Returns the same as the deprecated
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext) method (ie. |
boolean |
canXpath(Predicate p,
EvaluationContext context)
Returns the inverted boolean value of the deprecated
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext) method (ie. |
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 . |
static String |
getType(Predicate p,
EvaluationContext context)
Returns and validates the type from the predicate.
|
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. |
getOrderByComparator, isFiltering
public static final String TYPE
public String getXPathExpression(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
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).getXPathExpression
in interface PredicateEvaluator
getXPathExpression
in class AbstractPredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationpublic boolean includes(Predicate p, Row row, EvaluationContext context)
AbstractPredicateEvaluator
true
, ie. it does
not "touch" the result set at all.includes
in interface PredicateEvaluator
includes
in class AbstractPredicateEvaluator
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 evaluationtrue
if this row should be part of the final result
set, false
if it should be droppedpublic static String getType(Predicate p, EvaluationContext context)
null
.public boolean canXpath(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not
overridden, true
).canXpath
in interface PredicateEvaluator
canXpath
in class AbstractPredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationtrue
if this evaluator can express itself via xpath,
ie. PredicateEvaluator.getXPathExpression(Predicate, EvaluationContext)
public boolean canFilter(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not
overridden, false
).canFilter
in interface PredicateEvaluator
canFilter
in class AbstractPredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationtrue
if this evaluator can be express itself via
filtering, ie.
PredicateEvaluator.includes(Predicate, Row, EvaluationContext)
public String[] getOrderByProperties(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
null
.getOrderByProperties
in interface PredicateEvaluator
getOrderByProperties
in class AbstractPredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationnull
public FacetExtractor getFacetExtractor(Predicate predicate, EvaluationContext context)
AbstractPredicateEvaluator
null
, ie. no
facets will be extracted for the predicate.getFacetExtractor
in interface PredicateEvaluator
getFacetExtractor
in class AbstractPredicateEvaluator
predicate
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationFacetExtractor
that is used to create a Facet
or null
if no extractor shall be provided"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"