Interface Expression
- All Known Implementing Classes:
AbstractGetValueExpression,BeanWrapperExpression,CollectionAddingExpression,CompositeStringExpression,ELExpression,LiteralExpression,SpringELExpression,StaticExpression
public interface Expression
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 independent of any language like
Spring EL or the Unified EL.
- Author:
- Keith Donald
-
Method Summary
Modifier and TypeMethodDescriptionReturns the original string used to create this expression, unmodified.Evaluate this expression in the provided context and return the result of evaluation.Class<?>getValueType(Object context) Returns the most general type that can be passed to thesetValue(Object, Object)method for the given context.voidSet this expression in the provided context to the value provided.
-
Method Details
-
getValue
Evaluate this expression in the provided context and return the result of evaluation.- Parameters:
context- the context to evaluate this expression in- Returns:
- the evaluation result
- Throws:
EvaluationException- an exception occurred during expression evaluation
-
setValue
Set this expression in the provided context to the value provided.- Parameters:
context- the context on which the new value should be setvalue- the new value to set- Throws:
EvaluationException- an exception occurred during expression evaluation
-
getValueType
Returns the most general type that can be passed to thesetValue(Object, Object)method for the given context.- Parameters:
context- the context to evaluate- Returns:
- the most general type of value that can be set on this context, or
nullif the type information cannot be determined - Throws:
EvaluationException- an exception occurred during expression evaluation
-
getExpressionString
String getExpressionString()Returns the original string used to create this expression, unmodified.- Returns:
- the original expression string
-