class CacheOperationExpressionEvaluator extends CachedExpressionEvaluator
Performs internal caching for performance reasons
using AnnotatedElementKey
.
CachedExpressionEvaluator.ExpressionKey
Modifier and Type | Field and Description |
---|---|
private java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> |
conditionCache |
private java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> |
keyCache |
static java.lang.Object |
NO_RESULT
Indicate that there is no result variable.
|
static java.lang.Object |
RESULT_UNAVAILABLE
Indicate that the result variable cannot be used at all.
|
static java.lang.String |
RESULT_VARIABLE
The name of the variable holding the result object.
|
private java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> |
unlessCache |
Constructor and Description |
---|
CacheOperationExpressionEvaluator() |
Modifier and Type | Method and Description |
---|---|
(package private) void |
clear()
Clear all caches.
|
boolean |
condition(java.lang.String conditionExpression,
AnnotatedElementKey methodKey,
EvaluationContext evalContext) |
EvaluationContext |
createEvaluationContext(java.util.Collection<? extends Cache> caches,
java.lang.reflect.Method method,
java.lang.Object[] args,
java.lang.Object target,
java.lang.Class<?> targetClass,
java.lang.reflect.Method targetMethod,
java.lang.Object result,
BeanFactory beanFactory)
Create an
EvaluationContext . |
java.lang.Object |
key(java.lang.String keyExpression,
AnnotatedElementKey methodKey,
EvaluationContext evalContext) |
boolean |
unless(java.lang.String unlessExpression,
AnnotatedElementKey methodKey,
EvaluationContext evalContext) |
getExpression, getParameterNameDiscoverer, getParser
public static final java.lang.Object NO_RESULT
public static final java.lang.Object RESULT_UNAVAILABLE
public static final java.lang.String RESULT_VARIABLE
private final java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> keyCache
private final java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> conditionCache
private final java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> unlessCache
public EvaluationContext createEvaluationContext(java.util.Collection<? extends Cache> caches, java.lang.reflect.Method method, java.lang.Object[] args, java.lang.Object target, java.lang.Class<?> targetClass, java.lang.reflect.Method targetMethod, @Nullable java.lang.Object result, @Nullable BeanFactory beanFactory)
EvaluationContext
.caches
- the current cachesmethod
- the methodargs
- the method argumentstarget
- the target objecttargetClass
- the target classresult
- the return value (can be null
) or
NO_RESULT
if there is no return at this time@Nullable public java.lang.Object key(java.lang.String keyExpression, AnnotatedElementKey methodKey, EvaluationContext evalContext)
public boolean condition(java.lang.String conditionExpression, AnnotatedElementKey methodKey, EvaluationContext evalContext)
public boolean unless(java.lang.String unlessExpression, AnnotatedElementKey methodKey, EvaluationContext evalContext)
void clear()