类 ExpressionState
- java.lang.Object
- org.springframework.expression.spel.ExpressionState
public class ExpressionState extends Object
An ExpressionState is for maintaining per-expression-evaluation state, any changes to it are not seen by other expressions but it gives a place to hold local variables and for component expressions in a compound expression to communicate state. This is in contrast to the EvaluationContext, which is shared amongst expression evaluations, and any changes to it will be seen by other expressions or any code that chooses to ask questions of the context.It also acts as a place for to define common utility routines that the various AST nodes might need.
- 从以下版本开始:
- 3.0
- 作者:
- Andy Clement
构造器概要
构造器 构造器 说明 ExpressionState(EvaluationContext context)
ExpressionState(EvaluationContext context, SpelParserConfiguration configuration)
ExpressionState(EvaluationContext context, TypedValue rootObject)
ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
方法概要
构造器详细资料
ExpressionState
public ExpressionState(EvaluationContext context)
ExpressionState
public ExpressionState(EvaluationContext context, SpelParserConfiguration configuration)
ExpressionState
public ExpressionState(EvaluationContext context, TypedValue rootObject)
ExpressionState
public ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
方法详细资料
getActiveContextObject
public TypedValue getActiveContextObject()
The active context object is what unqualified references to properties/etc are resolved against.
pushActiveContextObject
public void pushActiveContextObject(TypedValue obj)
popActiveContextObject
public void popActiveContextObject()
getRootContextObject
public TypedValue getRootContextObject()
getScopeRootContextObject
public TypedValue getScopeRootContextObject()
setVariable
public void setVariable(String name, Object value)
lookupVariable
public TypedValue lookupVariable(String name)
getTypeComparator
public TypeComparator getTypeComparator()
findType
public Class<?> findType(String type) throws EvaluationException
convertValue
public Object convertValue(Object value, TypeDescriptor targetTypeDescriptor) throws EvaluationException
getTypeConverter
public TypeConverter getTypeConverter()
convertValue
public Object convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) throws EvaluationException
enterScope
public void enterScope(Map<String,Object> argMap)
enterScope
public void enterScope()
enterScope
public void enterScope(String name, Object value)
exitScope
public void exitScope()
setLocalVariable
public void setLocalVariable(String name, Object value)
lookupLocalVariable
public Object lookupLocalVariable(String name)
operate
public TypedValue operate(Operation op, Object left, Object right) throws EvaluationException
getPropertyAccessors
public List<PropertyAccessor> getPropertyAccessors()
getEvaluationContext
public EvaluationContext getEvaluationContext()
getConfiguration
public SpelParserConfiguration getConfiguration()