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) |
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, TypeDescriptor targetTypeDescriptor) throws EvaluationException
EvaluationException
public TypeConverter getTypeConverter()
@Nullable public Object convertValue(TypedValue value, 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()