public class ExpressionState
extends java.lang.Object
It also acts as a place for to define common utility routines that the various AST nodes might need.
Modifier and Type | Class and Description |
---|---|
private static class |
ExpressionState.VariableScope
A new scope is entered when a function is called and it is used to hold the
parameters to the function call.
|
Modifier and Type | Field and Description |
---|---|
private SpelParserConfiguration |
configuration |
private java.util.Stack<TypedValue> |
contextObjects |
private EvaluationContext |
relatedContext |
private TypedValue |
rootObject |
private java.util.Stack<TypedValue> |
scopeRootObjects |
private java.util.Stack<ExpressionState.VariableScope> |
variableScopes |
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 |
---|---|
java.lang.Object |
convertValue(java.lang.Object value,
TypeDescriptor targetTypeDescriptor) |
java.lang.Object |
convertValue(TypedValue value,
TypeDescriptor targetTypeDescriptor) |
void |
enterScope() |
void |
enterScope(java.util.Map<java.lang.String,java.lang.Object> argMap) |
void |
enterScope(java.lang.String name,
java.lang.Object value) |
void |
exitScope() |
java.lang.Class<?> |
findType(java.lang.String type) |
TypedValue |
getActiveContextObject()
The active context object is what unqualified references to properties/etc are resolved against.
|
SpelParserConfiguration |
getConfiguration() |
EvaluationContext |
getEvaluationContext() |
java.util.List<PropertyAccessor> |
getPropertyAccessors() |
TypedValue |
getRootContextObject() |
TypedValue |
getScopeRootContextObject() |
TypeComparator |
getTypeComparator() |
TypeConverter |
getTypeConverter() |
private java.util.Stack<TypedValue> |
initScopeRootObjects() |
private java.util.Stack<ExpressionState.VariableScope> |
initVariableScopes() |
java.lang.Object |
lookupLocalVariable(java.lang.String name) |
TypedValue |
lookupVariable(java.lang.String name) |
TypedValue |
operate(Operation op,
java.lang.Object left,
java.lang.Object right) |
void |
popActiveContextObject() |
void |
pushActiveContextObject(TypedValue obj) |
void |
setLocalVariable(java.lang.String name,
java.lang.Object value) |
void |
setVariable(java.lang.String name,
java.lang.Object value) |
private final EvaluationContext relatedContext
private final TypedValue rootObject
private final SpelParserConfiguration configuration
@Nullable private java.util.Stack<TypedValue> contextObjects
@Nullable private java.util.Stack<ExpressionState.VariableScope> variableScopes
@Nullable private java.util.Stack<TypedValue> scopeRootObjects
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 void setVariable(java.lang.String name, @Nullable java.lang.Object value)
public TypedValue lookupVariable(java.lang.String name)
public TypeComparator getTypeComparator()
public java.lang.Class<?> findType(java.lang.String type) throws EvaluationException
EvaluationException
public java.lang.Object convertValue(java.lang.Object value, TypeDescriptor targetTypeDescriptor) throws EvaluationException
EvaluationException
public TypeConverter getTypeConverter()
@Nullable public java.lang.Object convertValue(TypedValue value, TypeDescriptor targetTypeDescriptor) throws EvaluationException
EvaluationException
public void enterScope(java.util.Map<java.lang.String,java.lang.Object> argMap)
public void enterScope()
public void enterScope(java.lang.String name, java.lang.Object value)
public void exitScope()
public void setLocalVariable(java.lang.String name, java.lang.Object value)
@Nullable public java.lang.Object lookupLocalVariable(java.lang.String name)
private java.util.Stack<ExpressionState.VariableScope> initVariableScopes()
private java.util.Stack<TypedValue> initScopeRootObjects()
public TypedValue operate(Operation op, @Nullable java.lang.Object left, @Nullable java.lang.Object right) throws EvaluationException
EvaluationException
public java.util.List<PropertyAccessor> getPropertyAccessors()
public EvaluationContext getEvaluationContext()
public SpelParserConfiguration getConfiguration()