Interface RecursionInterceptor
- All Known Implementing Classes:
PrefixAwareRecursionInterceptor
,SimpleRecursionInterceptor
public interface RecursionInterceptor
Logs expressions before resolution is attempted, and clears them
after resolution is complete (or, fails all strategies). In between,
if the value of an expression contains more expressions, RecursionInterceptor
implementations ensure that those expressions don't reference an expression
which is in the process of being resolved. If that happens, the expression
references are cyclical, and would otherwise result in an infinite loop.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Reset the interceptorvoid
expressionResolutionFinished
(String expression) Signal to the interceptor that the all efforts to resolve the given expression have completed - whether successfully or not is irrelevant - and that the expression should not be tracked for recursion any longer.void
expressionResolutionStarted
(String expression) Log the intention to start resolving the given expression.getExpressionCycle
(String expression) boolean
hasRecursiveExpression
(String value) Check whether the given value contains an expression that is currently being tracked by this interceptor.
-
Method Details
-
expressionResolutionStarted
Log the intention to start resolving the given expression. This signals the interceptor to start tracking that expression to make sure it doesn't come up again until after it has been resolved (or, fails to resolve).- Parameters:
expression
- The expression to be resolved.
-
expressionResolutionFinished
Signal to the interceptor that the all efforts to resolve the given expression have completed - whether successfully or not is irrelevant - and that the expression should not be tracked for recursion any longer.- Parameters:
expression
- The expression to stop tracking.
-
hasRecursiveExpression
Check whether the given value contains an expression that is currently being tracked by this interceptor. If so, that expression is still in the process of being resolved, and this constitutes an expression cycle.- Parameters:
value
- The value to check for expression cycles.- Returns:
- True if the value contains tracked expressions; false otherwise.
-
getExpressionCycle
- Parameters:
expression
- the expression to start with.- Returns:
- The list of expressions that participate in the cycle caused by the given expression.
-
clear
void clear()Reset the interceptor
-