class ExpressionEvaluator 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.
|
private ParameterNameDiscoverer |
paramNameDiscoverer |
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<AnnotatedElementKey,java.lang.reflect.Method> |
targetMethodCache |
private java.util.Map<CachedExpressionEvaluator.ExpressionKey,Expression> |
unlessCache |
Constructor and Description |
---|
ExpressionEvaluator() |
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)
Create an
EvaluationContext without a return value. |
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.Object result)
Create an
EvaluationContext . |
private java.lang.reflect.Method |
getTargetMethod(java.lang.Class<?> targetClass,
java.lang.reflect.Method method) |
java.lang.Object |
key(java.lang.String keyExpression,
AnnotatedElementKey methodKey,
EvaluationContext evalContext) |
boolean |
unless(java.lang.String unlessExpression,
AnnotatedElementKey methodKey,
EvaluationContext evalContext) |
getExpression, 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 ParameterNameDiscoverer paramNameDiscoverer
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
private final java.util.Map<AnnotatedElementKey,java.lang.reflect.Method> targetMethodCache
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)
EvaluationContext
without a return value.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.Object result)
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 timepublic 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()
private java.lang.reflect.Method getTargetMethod(java.lang.Class<?> targetClass, java.lang.reflect.Method method)