RecursionInterceptor
public class PrefixAwareRecursionInterceptor extends java.lang.Object implements RecursionInterceptor
RecursionInterceptor
implementation that provides support for expressions
with multiple synonyms, such as project.build.directory == pom.build.directory ==
build.directory in Maven's POM.Modifier and Type | Field | Description |
---|---|---|
static java.lang.String |
DEFAULT_END_TOKEN |
|
static java.lang.String |
DEFAULT_START_TOKEN |
Constructor | Description |
---|---|
PrefixAwareRecursionInterceptor(java.util.Collection<java.lang.String> possiblePrefixes) |
Use the specified expression prefixes to detect synonyms.
|
PrefixAwareRecursionInterceptor(java.util.Collection<java.lang.String> possiblePrefixes,
boolean watchUnprefixedExpressions) |
Use the specified expression prefixes to detect synonyms, and specify whether
unprefixed expressions can be considered synonyms.
|
Modifier and Type | Method | Description |
---|---|---|
void |
clear() |
Reset the interceptor
|
void |
expressionResolutionFinished(java.lang.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(java.lang.String expression) |
Log the intention to start resolving the given expression.
|
java.util.List |
getExpressionCycle(java.lang.String expression) |
When an expression is determined to be a recursive reference, this method
returns the sublist of tracked expressions that participate in this cycle.
|
boolean |
hasRecursiveExpression(java.lang.String expression) |
Check whether the given value contains an expression that is currently
being tracked by this interceptor.
|
public static final java.lang.String DEFAULT_START_TOKEN
public static final java.lang.String DEFAULT_END_TOKEN
public PrefixAwareRecursionInterceptor(java.util.Collection<java.lang.String> possiblePrefixes, boolean watchUnprefixedExpressions)
possiblePrefixes
- The collection of expression prefixes supportedwatchUnprefixedExpressions
- Whether to consider unprefixed expressions as synonymspublic PrefixAwareRecursionInterceptor(java.util.Collection<java.lang.String> possiblePrefixes)
possiblePrefixes
- The collection of expression prefixes supportedpublic boolean hasRecursiveExpression(java.lang.String expression)
RecursionInterceptor
hasRecursiveExpression
in interface RecursionInterceptor
expression
- The value to check for expression cycles.public void expressionResolutionFinished(java.lang.String expression)
RecursionInterceptor
expressionResolutionFinished
in interface RecursionInterceptor
expression
- The expression to stop tracking.public void expressionResolutionStarted(java.lang.String expression)
RecursionInterceptor
expressionResolutionStarted
in interface RecursionInterceptor
expression
- The expression to be resolved.public java.util.List getExpressionCycle(java.lang.String expression)
Collections.EMPTY_LIST
. Also, if the expression doesn't have a matched
prefix from this interceptor's list, and unprefixed expressions aren't allowed
then return Collections.EMPTY_LIST
.getExpressionCycle
in interface RecursionInterceptor
expression
- the expression to start with.public void clear()
RecursionInterceptor
clear
in interface RecursionInterceptor
Copyright © 2018. All rights reserved.