public class DatePrefix extends BaseNumericalPrefix
Supports at least the three mandatory HTTP formats (RFC 822, RFC 850,
asctime), ISO 8601 formats, and the nglib date format (YYYY/MM/DD-HH:MM:SS),
and many other ones.
PrefixHandler.ErrorBehaviour, PrefixHandler.NoHooks, PrefixHandler.Phase
defaultOperator, errorBehaviour, lsb, msb, numop, targetIndexField, useAttributes
Constructor and Description |
---|
DatePrefix(java.lang.String targetIndexField,
IndexOptions.NumericalOperator defaultOp,
boolean time)
Create a date or time prefix handler.
|
DatePrefix(java.lang.String targetIndexField,
IndexOptions.NumericalOperator defaultOp,
boolean time,
java.lang.String format) |
Modifier and Type | Method and Description |
---|---|
protected Node |
buildNumericalValueNode(Node node,
java.lang.String context,
java.lang.String dateValue,
IndexOptions indexOptions,
IndexOptions.NumericalOperator operator) |
Node |
handlePrefix(PrefixHandler.Phase phase,
PrefixNode node,
NodeVisitor parentVisitor,
QueryContext queryContext)
Handle a given prefix node.
|
protected RangeNode |
makeBoundariesInclusive(RangeNode node)
Numerical ranges are for inclusive intervals.
|
onDeinit, onInit, onQuery, setErrorBehaviour, setParams
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitNary, visitUnary
public DatePrefix(java.lang.String targetIndexField, IndexOptions.NumericalOperator defaultOp, boolean time)
targetIndexField
- The index field to targetdefaultOp
- Overrides the operator if default ":" is usedtime
- True if the targeted index field is of type time, false
otherwise (type date)public DatePrefix(java.lang.String targetIndexField, IndexOptions.NumericalOperator defaultOp, boolean time, java.lang.String format)
protected Node buildNumericalValueNode(Node node, java.lang.String context, java.lang.String dateValue, IndexOptions indexOptions, IndexOptions.NumericalOperator operator) throws QueryProcessingException
QueryProcessingException
protected RangeNode makeBoundariesInclusive(RangeNode node)
public Node handlePrefix(PrefixHandler.Phase phase, PrefixNode node, NodeVisitor parentVisitor, QueryContext queryContext) throws QueryProcessingException
PrefixHandler
handlePrefix
in interface PrefixHandler
handlePrefix
in class BaseNumericalPrefix
phase
- the "Phase" of the prefix handler, indicating how far in
the pipeline we are.In the standard chain, 4 phases are defined:
PRE_LINGUISTIC, PRE_TRANSFORM, PRE_MAP, POST_MAPnode
- The prefix node to handleparentVisitor
- If your handler is not "terminal", ie, if it
supports nesting, it should call this visitor to visit the prefix
node's content, additionally to performing its work. Warning: this
can be null, in that case, you must not delegate.queryContext
- access to overridable query-related parametersQueryProcessingException
Copyright © 2013 Dassault Systèmes, All Rights Reserved.