Interface ValueExpression
public interface ValueExpression
An expression capable of evaluating itself against context objects. Encapsulates the details of a previously parsed
expression string. Provides a common abstraction for expression evaluation.
- Since:
- 3.3
- Author:
- Christoph Strobl, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionevaluate
(ValueEvaluationContext context) Evaluates this expression using the given evaluation context.default ExpressionDependencies
Returns the expression dependencies.Returns the original string used to create this expression (unmodified).Class<?>
getValueType
(ValueEvaluationContext context) Return the most general type that the expression would use as return type for the given context.boolean
Returns whether the expression is a literal expression (that doesn't actually require evaluation).
-
Method Details
-
getExpressionString
String getExpressionString()Returns the original string used to create this expression (unmodified).- Returns:
- the original expression string.
-
getExpressionDependencies
Returns the expression dependencies.- Returns:
- the dependencies the underlying expression requires. Can be
ExpressionDependencies.none()
.
-
isLiteral
boolean isLiteral()Returns whether the expression is a literal expression (that doesn't actually require evaluation).- Returns:
true
if the expression is a literal expression;false
if the expression can yield a different result uponevaluation
.
-
evaluate
Evaluates this expression using the given evaluation context.- Returns:
- the evaluation result.
- Throws:
EvaluationException
- if there is a problem during evaluation
-
getValueType
Return the most general type that the expression would use as return type for the given context.- Parameters:
context
- the context in which to evaluate the expression.- Returns:
- the most general type of value.
- Throws:
EvaluationException
- if there is a problem determining the type- Since:
- 3.4
-