Also defines a set of "unavailable variables" (i.e. variables that should lead to an exception as soon as they are accessed). This can be useful to verify a condition does not match even when not all potential variables are present.
To limit the creation of objects, an ugly constructor is used (rather than a dedicated 'closure'-like class for deferred execution).
| Access | Constructor and Description |
|---|---|
| pack-priv | CacheEvaluationContext(Object rootObject, Method method, Object[] arguments, ParameterNameDiscoverer parameterNameDiscoverer)
|
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public Object | lookupVariable(String
the name of the variable or function to look up name)Overrides org. Implements org. Load the param information only when needed. |
| unavailableVariables | back to summary |
|---|---|
| private final Set<String> unavailableVariables | |
| CacheEvaluationContext | back to summary |
|---|---|
| pack-priv CacheEvaluationContext(Object rootObject, Method method, Object[] arguments, ParameterNameDiscoverer parameterNameDiscoverer) | |
| addUnavailableVariable | back to summary |
|---|---|
| public void addUnavailableVariable(String name) Add the specified variable name as unavailable for this context. Any expression trying to access this variable should lead to an exception. This permits the validation of expressions that could potentially access a variable even when such a variable isn't available yet. Any expression trying to use that variable should therefore fail to evaluate. | |
| lookupVariable | back to summary |
|---|---|
| public Object lookupVariable(String name) Overrides org. Implements org. Load the param information only when needed.
| |