Class DateTimeNewFunction
- java.lang.Object
-
- com.ezylang.evalex.functions.AbstractFunction
-
- com.ezylang.evalex.functions.datetime.DateTimeNewFunction
-
- All Implemented Interfaces:
FunctionIfc
@FunctionParameter(name="values", isVarArg=true, nonNegative=true) public class DateTimeNewFunction extends AbstractFunction
Creates a new DATE_TIME value with the given parameters. If only one parameter is given, it is treated as the time in milliseconds from the epoch of 1970-01-01T00:00:00Z and a corresponding date/time value is created. Else, A minimum of three parameters (year, month, day) must be specified. Optionally the hour, minute, second and nanosecond can be specified. If the last parameter is a string value, it is treated as a zone ID. If no zone ID is specified, the configured zone ID is used.
-
-
Field Summary
-
Fields inherited from class com.ezylang.evalex.functions.AbstractFunction
MINUS_ONE
-
-
Constructor Summary
Constructors Constructor Description DateTimeNewFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description EvaluationValueevaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues)Performs the function logic and returns an evaluation result.voidvalidatePreEvaluation(Token token, EvaluationValue... parameterValues)Validates the evaluation parameters, called before the actual evaluation.-
Methods inherited from class com.ezylang.evalex.functions.AbstractFunction
getFunctionParameterDefinitions, hasVarArgs
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ezylang.evalex.functions.FunctionIfc
getCountOfNonVarArgParameters, isParameterLazy
-
-
-
-
Method Detail
-
evaluate
public EvaluationValue evaluate(Expression expression, Token functionToken, EvaluationValue... parameterValues) throws EvaluationException
Description copied from interface:FunctionIfcPerforms the function logic and returns an evaluation result.- Parameters:
expression- The expression, where this function is executed. Can be used to access the expression configuration.functionToken- The function token from the parsed expression.parameterValues- The parameter values.- Returns:
- The evaluation result in form of a
EvaluationValue. - Throws:
EvaluationException- In case there were problems during evaluation.
-
validatePreEvaluation
public void validatePreEvaluation(Token token, EvaluationValue... parameterValues) throws EvaluationException
Description copied from interface:FunctionIfcValidates the evaluation parameters, called before the actual evaluation.- Specified by:
validatePreEvaluationin interfaceFunctionIfc- Overrides:
validatePreEvaluationin classAbstractFunction- Parameters:
token- The function token.parameterValues- The parameter values- Throws:
EvaluationException- in case of any validation error
-
-