public abstract class DateComparingMacro extends Object implements Macro
macros
handling date comparisonConstructor and Description |
---|
DateComparingMacro() |
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
compare(LocalDateTime firstDate,
LocalDateTime secondDate) |
Object |
eval(LocalRenderContext ctx,
Expression[] args)
Evaluates the macro at runtime.
|
Class<?> |
getType()
Returns the type of objects returned by this macro.
|
boolean |
isConstant(Expression[] args)
Determines if the macro is "constant" for the given parameter expressions.
|
protected LocalDateTime |
parseInput(Object object) |
void |
verifyArguments(List<Expression> args)
Verifies the arguments.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dereference, getDescription
public Class<?> getType()
Macro
public boolean isConstant(Expression[] args)
Macro
isConstant
in interface Macro
args
- the arguments of the macroprotected LocalDateTime parseInput(Object object)
public Object eval(LocalRenderContext ctx, Expression[] args)
Macro
Note that the arguments are still expressions and have to be evaluated on demand.
protected abstract boolean compare(LocalDateTime firstDate, LocalDateTime secondDate)
public void verifyArguments(List<Expression> args)
Macro
This is used to verify the type and count of arguments at compile time. If one or more arguments are invalid an
IllegalArgumentException
can be thrown.
verifyArguments
in interface Macro
args
- the expressions which will be passed in at runtime.Copyright © 2018. All rights reserved.