接口 EvaluationContext
public interface EvaluationContext
Expressions are executed in an evaluation context. It is in this context that references are resolved when encountered during expression evaluation.There is a default implementation of this EvaluationContext interface:
StandardEvaluationContext
which can be extended, rather than having to implement everything manually.- 从以下版本开始:
- 3.0
- 作者:
- Andy Clement, Juergen Hoeller
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 BeanResolver
getBeanResolver()
Return a bean resolver that can look up beans by name.List<ConstructorResolver>
getConstructorResolvers()
Return a list of resolvers that will be asked in turn to locate a constructor.List<MethodResolver>
getMethodResolvers()
Return a list of resolvers that will be asked in turn to locate a method.OperatorOverloader
getOperatorOverloader()
Return an operator overloader that may support mathematical operations between more than the standard set of types.List<PropertyAccessor>
getPropertyAccessors()
Return a list of accessors that will be asked in turn to read/write a property.TypedValue
getRootObject()
Return the default root context object against which unqualified properties/methods/etc should be resolved.TypeComparator
getTypeComparator()
Return a type comparator for comparing pairs of objects for equality.TypeConverter
getTypeConverter()
Return a type converter that can convert (or coerce) a value from one type to another.TypeLocator
getTypeLocator()
Return a type locator that can be used to find types, either by short or fully qualified name.Object
lookupVariable(String name)
Look up a named variable within this evaluation context.void
setVariable(String name, Object value)
Set a named variable within this evaluation context to a specified value.
方法详细资料
getRootObject
TypedValue getRootObject()
Return the default root context object against which unqualified properties/methods/etc should be resolved. This can be overridden when evaluating an expression.
getPropertyAccessors
List<PropertyAccessor> getPropertyAccessors()
Return a list of accessors that will be asked in turn to read/write a property.
getConstructorResolvers
List<ConstructorResolver> getConstructorResolvers()
Return a list of resolvers that will be asked in turn to locate a constructor.
getMethodResolvers
List<MethodResolver> getMethodResolvers()
Return a list of resolvers that will be asked in turn to locate a method.
getBeanResolver
BeanResolver getBeanResolver()
Return a bean resolver that can look up beans by name.
getTypeLocator
TypeLocator getTypeLocator()
Return a type locator that can be used to find types, either by short or fully qualified name.
getTypeConverter
TypeConverter getTypeConverter()
Return a type converter that can convert (or coerce) a value from one type to another.
getTypeComparator
TypeComparator getTypeComparator()
Return a type comparator for comparing pairs of objects for equality.
getOperatorOverloader
OperatorOverloader getOperatorOverloader()
Return an operator overloader that may support mathematical operations between more than the standard set of types.
setVariable
void setVariable(String name, Object value)
Set a named variable within this evaluation context to a specified value.- 参数:
name
- variable to setvalue
- value to be placed in the variable
lookupVariable
Object lookupVariable(String name)
Look up a named variable within this evaluation context.- 参数:
name
- variable to lookup- 返回:
- the value of the variable, or
null
if not found