org.springframework.cache.interceptor
Class LazyParamAwareEvaluationContext
java.lang.Object
org.springframework.expression.spel.support.StandardEvaluationContext
org.springframework.cache.interceptor.LazyParamAwareEvaluationContext
- All Implemented Interfaces:
- EvaluationContext
class LazyParamAwareEvaluationContext
- extends StandardEvaluationContext
Evaluation context class that adds a method parameters as SpEL
variables, in a lazy manner. The lazy nature eliminates unneeded
parsing of classes byte code for parameter discovery.
To limit the creation of objects, an ugly constructor is used
(rather then a dedicated 'closure'-like class for deferred execution).
- Since:
- 3.1
- Author:
- Costin Leau
Constructor Summary |
LazyParamAwareEvaluationContext(java.lang.Object rootObject,
ParameterNameDiscoverer paramDiscoverer,
java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Class<?> targetClass,
java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> methodCache)
|
Methods inherited from class org.springframework.expression.spel.support.StandardEvaluationContext |
addConstructorResolver, addMethodResolver, addPropertyAccessor, getBeanResolver, getConstructorResolvers, getMethodResolvers, getOperatorOverloader, getPropertyAccessors, getRootObject, getTypeComparator, getTypeConverter, getTypeLocator, registerFunction, registerMethodFilter, removeConstructorResolver, removeMethodResolver, removePropertyAccessor, setBeanResolver, setConstructorResolvers, setMethodResolvers, setOperatorOverloader, setPropertyAccessors, setRootObject, setRootObject, setTypeComparator, setTypeConverter, setTypeLocator, setVariable, setVariables |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
paramDiscoverer
private final ParameterNameDiscoverer paramDiscoverer
method
private final java.lang.reflect.Method method
args
private final java.lang.Object[] args
targetClass
private final java.lang.Class<?> targetClass
methodCache
private final java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> methodCache
paramLoaded
private boolean paramLoaded
LazyParamAwareEvaluationContext
LazyParamAwareEvaluationContext(java.lang.Object rootObject,
ParameterNameDiscoverer paramDiscoverer,
java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Class<?> targetClass,
java.util.Map<java.lang.reflect.Method,java.lang.reflect.Method> methodCache)
lookupVariable
public java.lang.Object lookupVariable(java.lang.String name)
- Load the param information only when needed.
- Specified by:
lookupVariable
in interface EvaluationContext
- Overrides:
lookupVariable
in class StandardEvaluationContext
- Parameters:
name
- variable to lookup
- Returns:
- the value of the variable
loadArgsAsVariables
private void loadArgsAsVariables()