public class RelativeDateRangePredicateEvaluator extends DateRangePredicateEvaluator
RelativeDateRangePredicateEvaluator is an extension of the
DateRangePredicateEvaluator that does not use absolute UNIX
timestamps for lowerBound and upperBound, but
relative offsets to the current server time. If you only specify either one,
the default value will be 0, indicating now.
It also supports the bugzilla syntax 1s 2m 3h 4d 5w 6M 7y (one second, two minutes, three hours, four days, five weeks, 6 months, 7 years). It does not take leap years into consideration and all months are 30 days.
Note: Does not implement filtering, which means this predicate cannot be used together with filter-only predicates in an OR group.
upperBound=3600000lowerBound=-86400000lowerBound=86400000, upperBound=172800000EARLIER_THAN_LAST_YEAR, LAST_THREE_MONTHS, LAST_YEAR, THIS_MONTH, THIS_WEEK, THIS_YEAR, TIME_ZONE, TODAYLOWER_BOUND, LOWER_OPERATION, PROPERTY, PROPERTY_DECIMAL, UPPER_BOUND, UPPER_OPERATION| Constructor and Description |
|---|
RelativeDateRangePredicateEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getXPathExpression(Predicate p,
EvaluationContext context)
Default implementation that always returns
null, ie. |
long |
parseDateRange(java.lang.String daterange) |
canFilter, canXpath, getFacetExtractor, parseDateStringgetOrderByProperties, includesgetOrderByComparator, isFilteringpublic java.lang.String getXPathExpression(Predicate p, EvaluationContext context)
AbstractPredicateEvaluatornull, 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 PredicateEvaluatorgetXPathExpression in class DateRangePredicateEvaluatorp - predicate (for this evaluator type) which is evaluatedcontext - helper class which provides access to various elements of the
query evaluationpublic long parseDateRange(java.lang.String daterange)
throws java.lang.NumberFormatException
java.lang.NumberFormatException"Copyright © 2010 - 2018 Adobe Systems Incorporated. All Rights Reserved"