public class SpringELExpression extends java.lang.Object implements Expression
Expression
allowing it to be used under the Spring Binding Expression abstraction.| Constructor and Description |
|---|
SpringELExpression(org.springframework.expression.Expression expression,
java.lang.Class<?> expectedType,
EvaluationContextFactory contextFactory)
Generalized constructor variant that accepts an
EvaluationContextFactory. |
SpringELExpression(org.springframework.expression.Expression expression,
java.util.Map<java.lang.String,Expression> expressionVars,
java.lang.Class<?> expectedType,
org.springframework.core.convert.ConversionService conversionService,
java.util.List<org.springframework.expression.PropertyAccessor> propertyAccessors)
Constructor for SpringELExpression.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
extendEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext context)
Deprecated.
as of 2.4.8, to customize the context, please use the constructor
that accepts an
EvaluationContextFactory. |
java.lang.String |
getExpressionString()
Returns the original string used to create this expression, unmodified.
|
java.lang.Object |
getValue(java.lang.Object rootObject)
Evaluate this expression in the provided context and return the result of evaluation.
|
java.lang.Class<?> |
getValueType(java.lang.Object rootObject)
Returns the most general type that can be passed to the
Expression.setValue(Object, Object) method for the given
context. |
void |
setValue(java.lang.Object rootObject,
java.lang.Object value)
Set this expression in the provided context to the value provided.
|
java.lang.String |
toString() |
public SpringELExpression(org.springframework.expression.Expression expression,
java.util.Map<java.lang.String,Expression> expressionVars,
java.lang.Class<?> expectedType,
org.springframework.core.convert.ConversionService conversionService,
java.util.List<org.springframework.expression.PropertyAccessor> propertyAccessors)
expression - a parsed Spring EL expression instance. Must not be null.expressionVars - provides a mapping between variables names and
parsed Spring EL expression instances.
This parameter is optional (may be null).expectedType - the target type expected from the evaluation of the expression or null.
This parameter is optional (may be null).conversionService - the Spring ConversionService instance to use for type conversionpropertyAccessors - propertyAccessors for Spring EL to use when evaluating expressionspublic SpringELExpression(org.springframework.expression.Expression expression,
java.lang.Class<?> expectedType,
EvaluationContextFactory contextFactory)
EvaluationContextFactory.public java.lang.String getExpressionString()
ExpressiongetExpressionString in interface Expressionpublic java.lang.Object getValue(java.lang.Object rootObject)
throws EvaluationException
ExpressiongetValue in interface ExpressionrootObject - the context to evaluate this expression inEvaluationException - an exception occurred during expression evaluationpublic java.lang.Class<?> getValueType(java.lang.Object rootObject)
throws EvaluationException
ExpressionExpression.setValue(Object, Object) method for the given
context.getValueType in interface ExpressionrootObject - the context to evaluatenull if the type
information cannot be determinedEvaluationException - an exception occurred during expression evaluationpublic void setValue(java.lang.Object rootObject,
java.lang.Object value)
throws EvaluationException
ExpressionsetValue in interface ExpressionrootObject - the context on which the new value should be setvalue - the new value to setEvaluationException - an exception occurred during expression evaluation@Deprecated protected void extendEvaluationContext(org.springframework.expression.spel.support.StandardEvaluationContext context)
EvaluationContextFactory.public java.lang.String toString()
toString in class java.lang.Object