public class DateRangePredicateEvaluator extends RangePropertyPredicateEvaluator
DateRangePropertyPredicate
is a generic evaluator for
checking a jcr DATE property against an interval. This uses the ISO8601
format for dates (YYYY-MM-DDTHH:mm:ss.SSSZ
) and allows also partial
representations (eg. YYYY-MM-DD
). You can also provide the
dates (for the bounds) as number of milliseconds since 1970 (UTC timezone,
basically the unix format).
You can define a lower bound and an upper bound or only one of them. The operation (eg. "lesser than" or "lesser or equals") can also be specified for lower and upper bound individually.
Note: Does not implement filtering, which means this predicate cannot be used together with filter-only predicates in an OR group.
Modifier and Type | Field and Description |
---|---|
static String |
EARLIER_THAN_LAST_YEAR |
static String |
LAST_THREE_MONTHS |
static String |
LAST_YEAR |
static String |
THIS_MONTH |
static String |
THIS_WEEK |
static String |
THIS_YEAR |
static String |
TIME_ZONE |
static String |
TODAY |
LOWER_BOUND, LOWER_OPERATION, PROPERTY, PROPERTY_DECIMAL, UPPER_BOUND, UPPER_OPERATION
Constructor and Description |
---|
DateRangePredicateEvaluator() |
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 p,
EvaluationContext context)
Default implementation that always returns
null , ie. |
String |
getXPathExpression(Predicate p,
EvaluationContext context)
Default implementation that always returns
null , ie. |
static String |
parseDateString(String dateString,
String timeZoneID,
Session session) |
getOrderByProperties, includes
getOrderByComparator, isFiltering
public static final String TIME_ZONE
public static final String TODAY
public static final String THIS_WEEK
public static final String THIS_MONTH
public static final String LAST_THREE_MONTHS
public static final String THIS_YEAR
public static final String LAST_YEAR
public static final String EARLIER_THAN_LAST_YEAR
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 RangePropertyPredicateEvaluator
p
- predicate (for this evaluator type) which is evaluatedcontext
- helper class which provides access to various elements of the
query evaluationpublic boolean canFilter(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not
overridden, false
).canFilter
in interface PredicateEvaluator
canFilter
in class RangePropertyPredicateEvaluator
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 boolean canXpath(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
AbstractPredicateEvaluator.isFiltering(Predicate, EvaluationContext)
method (ie. if not
overridden, true
).canXpath
in interface PredicateEvaluator
canXpath
in class RangePropertyPredicateEvaluator
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 static String parseDateString(String dateString, String timeZoneID, Session session)
public FacetExtractor getFacetExtractor(Predicate p, EvaluationContext context)
AbstractPredicateEvaluator
null
, ie. no
facets will be extracted for the predicate.getFacetExtractor
in interface PredicateEvaluator
getFacetExtractor
in class AbstractPredicateEvaluator
p
- 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"