public interface Expression
evaluated
.
If you want to evaluate an expression only once, you better use ExpressionEvaluator.evaluate(String, Mapping)
.Parser.parse()
Modifier and Type | Field and Description |
---|---|
static Expression |
FALSE
An expression which always evaluates to
false . |
static Expression |
NULL
An expression which always evaluates to
null . |
static Expression |
TRUE
An expression which always evaluates to
true . |
Modifier and Type | Method and Description |
---|---|
Object |
evaluate(Mapping<String,?> variables)
Computes the value of the expression
|
Object |
evaluate(Object... variableNamesAndValues)
Computes the value of the expression.
|
<T> T |
evaluateTo(Class<T> targetType,
Object... variableNamesAndValues) |
<T> T |
evaluateTo(Mapping<String,?> variables,
Class<T> targetType) |
boolean |
evaluateToBoolean(Mapping<String,?> variables) |
boolean |
evaluateToBoolean(Object... variableNamesAndValues) |
<T> T |
evaluateToPrimitive(Class<T> targetType,
Object... variableNamesAndValues) |
<T> T |
evaluateToPrimitive(Mapping<String,?> variables,
Class<T> targetType) |
static final Expression TRUE
true
.static final Expression FALSE
false
.static final Expression NULL
null
.@Nullable Object evaluate(Mapping<String,?> variables) throws EvaluationException
variables
- The values of the variables that were named when the expression was parsed. Allowed
values are String
, Integer
, Boolean
, any other Object
, or null
.String
, Integer
, Boolean
, any other {link Object}, or
null
EvaluationException
- A problem occurred during evaluation, e.g. any array element access was attempted
and the index value could not be converted to int
RuntimeException
- Any other runtime exception that occurred while evaluating the expression, e.g. an
IllegalArgumentException
when accessing an element of a non-array@Nullable Object evaluate(Object... variableNamesAndValues) throws EvaluationException
variableNamesAndValues
- Pairs of variable names and values; the even elements' type must be String
, the odd elements' type must be String
, Integer
, Boolean
, any other Object
, or null
.String
, Integer
, Boolean
, any other {link Object}, or
null
EvaluationException
- A problem occurred during evaluation, e.g. any array element access was attempted
and the index value could not be converted to int
RuntimeException
- Any other runtime exception that occurred while evaluating the expression, e.g. an
IllegalArgumentException
when accessing an element of a non-array@Nullable <T> T evaluateTo(Mapping<String,?> variables, Class<T> targetType) throws EvaluationException
EvaluationException
AbstractExpression.evaluateTo(Mapping, Class)
@Nullable <T> T evaluateTo(Class<T> targetType, Object... variableNamesAndValues) throws EvaluationException
EvaluationException
AbstractExpression.evaluateTo(Class, Object...)
<T> T evaluateToPrimitive(Mapping<String,?> variables, Class<T> targetType) throws EvaluationException
EvaluationException
AbstractExpression.evaluateToPrimitive(Mapping, Class)
<T> T evaluateToPrimitive(Class<T> targetType, Object... variableNamesAndValues) throws EvaluationException
EvaluationException
AbstractExpression.evaluateToPrimitive(Class, Object...)
boolean evaluateToBoolean(Mapping<String,?> variables) throws EvaluationException
EvaluationException
AbstractExpression.evaluateToBoolean(Mapping)
boolean evaluateToBoolean(Object... variableNamesAndValues) throws EvaluationException
EvaluationException
AbstractExpression.evaluateToBoolean(Object...)
Copyright © 2018 Arno Unkrig. All rights reserved.