类 ExpressionState
java.lang.Object
cn.taketoday.expression.spel.ExpressionState
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 to define common utility routines that the various AST nodes might need.
- 从以下版本开始:
- 4.0
- 作者:
- Andy Clement, Juergen Hoeller, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static classA new scope is entered when a function is called and it is used to hold the parameters to the function call. -
字段概要
字段修饰符和类型字段说明private final SpelParserConfigurationprivate Deque<TypedValue>private final EvaluationContextprivate final TypedValueprivate ArrayDeque<TypedValue>private Deque<ExpressionState.VariableScope> -
构造器概要
构造器构造器说明ExpressionState(EvaluationContext context) ExpressionState(EvaluationContext context, SpelParserConfiguration configuration) ExpressionState(EvaluationContext context, TypedValue rootObject) ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration) -
方法概要
修饰符和类型方法说明assignVariable(String name, Supplier<TypedValue> valueSupplier) Assign the value created by the specifiedSupplierto a named variable within the evaluation context.convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) convertValue(Object value, TypeDescriptor targetTypeDescriptor) voidvoidenterScope(String name, Object value) voidenterScope(Map<String, Object> argMap) voidClass<?>The active context object is what unqualified references to properties/etc are resolved against.private Deque<TypedValue>private Deque<ExpressionState.VariableScope>lookupLocalVariable(String name) lookupVariable(String name) voidvoidvoidsetLocalVariable(String name, Object value) voidsetVariable(String name, Object value) Set a named variable in the evaluation context to a specified value.
-
字段详细资料
-
rootObject
-
configuration
-
contextObjects
-
variableScopes
-
scopeRootObjects
-
构造器详细资料
-
ExpressionState
-
ExpressionState
-
ExpressionState
-
ExpressionState
public ExpressionState(EvaluationContext context, TypedValue rootObject, SpelParserConfiguration configuration)
-
-
方法详细资料
-
getActiveContextObject
The active context object is what unqualified references to properties/etc are resolved against. -
pushActiveContextObject
-
popActiveContextObject
public void popActiveContextObject() -
getRootContextObject
-
getScopeRootContextObject
-
assignVariable
Assign the value created by the specifiedSupplierto 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 variable- 返回:
- a
TypedValuewrapping the assigned value - 另请参阅:
-
setVariable
Set a named variable in the evaluation context to a specified 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 variable- 另请参阅:
-
lookupVariable
-
getTypeComparator
-
findType
-
convertValue
public Object convertValue(Object value, TypeDescriptor targetTypeDescriptor) throws EvaluationException -
getTypeConverter
-
convertValue
@Nullable public Object convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) throws EvaluationException -
enterScope
-
enterScope
public void enterScope() -
enterScope
-
exitScope
public void exitScope() -
setLocalVariable
-
lookupLocalVariable
-
initVariableScopes
-
initScopeRootObjects
-
operate
public TypedValue operate(Operation op, @Nullable Object left, @Nullable Object right) throws EvaluationException -
getPropertyAccessors
-
getEvaluationContext
-
getConfiguration
-