public class ExpressionState extends Object
It also acts as a place to define common utility routines that the various AST nodes might need.
Constructor and Description |
---|
ExpressionState(EvaluationContext context) |
ExpressionState(EvaluationContext context,
SpelParserConfiguration configuration) |
ExpressionState(EvaluationContext context,
TypedValue rootObject) |
ExpressionState(EvaluationContext context,
TypedValue rootObject,
SpelParserConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
TypedValue |
assignVariable(String name,
Supplier<TypedValue> valueSupplier)
Assign the value created by the specified
Supplier to a named variable
within the evaluation context. |
Object |
convertValue(Object value,
org.springframework.core.convert.TypeDescriptor targetTypeDescriptor) |
Object |
convertValue(TypedValue value,
org.springframework.core.convert.TypeDescriptor targetTypeDescriptor) |
void |
enterScope() |
void |
enterScope(Map<String,Object> argMap) |
void |
enterScope(String name,
Object value) |
void |
exitScope() |
Class<?> |
findType(String type) |
TypedValue |
getActiveContextObject()
The active context object is what unqualified references to properties/etc are resolved against.
|
SpelParserConfiguration |
getConfiguration() |
EvaluationContext |
getEvaluationContext() |
List<PropertyAccessor> |
getPropertyAccessors() |
TypedValue |
getRootContextObject() |
TypedValue |
getScopeRootContextObject() |
TypeComparator |
getTypeComparator() |
TypeConverter |
getTypeConverter() |
Object |
lookupLocalVariable(String name) |
TypedValue |
lookupVariable(String name) |
TypedValue |
operate(Operation op,
Object left,
Object right) |
void |
popActiveContextObject() |
void |
pushActiveContextObject(TypedValue obj) |
void |
setLocalVariable(String name,
Object value) |
void |
setVariable(String name,
Object value)
Set a named variable in the evaluation context to a specified value.
|
public ExpressionState(EvaluationContext context)
public ExpressionState(EvaluationContext context, SpelParserConfiguration configuration)
public ExpressionState(EvaluationContext context, TypedValue rootObject)
public ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
public TypedValue getActiveContextObject()
public void pushActiveContextObject(TypedValue obj)
public void popActiveContextObject()
public TypedValue getRootContextObject()
public TypedValue getScopeRootContextObject()
public TypedValue assignVariable(String name, Supplier<TypedValue> valueSupplier)
Supplier
to a named variable
within the evaluation context.
In contrast to setVariable(String, Object)
, this method should
only be invoked to support assignment within an expression.
name
- the name of the variable to assignvalueSupplier
- the supplier of the value to be assigned to the variableTypedValue
wrapping the assigned valueEvaluationContext.assignVariable(String, Supplier)
public void setVariable(String name, @Nullable Object value)
In contrast to assignVariable(String, Supplier)
, this method
should only be invoked programmatically.
name
- the name of the variable to setvalue
- the value to be placed in the variableEvaluationContext.setVariable(String, Object)
public TypedValue lookupVariable(String name)
public TypeComparator getTypeComparator()
public Class<?> findType(String type) throws EvaluationException
EvaluationException
public Object convertValue(Object value, org.springframework.core.convert.TypeDescriptor targetTypeDescriptor) throws EvaluationException
EvaluationException
public TypeConverter getTypeConverter()
@Nullable public Object convertValue(TypedValue value, org.springframework.core.convert.TypeDescriptor targetTypeDescriptor) throws EvaluationException
EvaluationException
public void enterScope()
public void exitScope()
public TypedValue operate(Operation op, @Nullable Object left, @Nullable Object right) throws EvaluationException
EvaluationException
public List<PropertyAccessor> getPropertyAccessors()
public EvaluationContext getEvaluationContext()
public SpelParserConfiguration getConfiguration()