public class PrefixAwareRecursionInterceptor extends 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 and Description |
---|---|
static String |
DEFAULT_END_TOKEN |
static String |
DEFAULT_START_TOKEN |
Constructor and Description |
---|
PrefixAwareRecursionInterceptor(Collection<String> possiblePrefixes)
Use the specified expression prefixes to detect synonyms.
|
PrefixAwareRecursionInterceptor(Collection<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 and Description |
---|---|
void |
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.
|
List |
getExpressionCycle(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(String expression)
Check whether the given value contains an expression that is currently
being tracked by this interceptor.
|
public static final String DEFAULT_START_TOKEN
public static final String DEFAULT_END_TOKEN
public PrefixAwareRecursionInterceptor(Collection<String> possiblePrefixes, boolean watchUnprefixedExpressions)
possiblePrefixes
- The collection of expression prefixes supportedwatchUnprefixedExpressions
- Whether to consider unprefixed expressions as synonymspublic PrefixAwareRecursionInterceptor(Collection<String> possiblePrefixes)
possiblePrefixes
- The collection of expression prefixes supportedpublic boolean hasRecursiveExpression(String expression)
RecursionInterceptor
hasRecursiveExpression
in interface RecursionInterceptor
expression
- The value to check for expression cycles.public void expressionResolutionFinished(String expression)
RecursionInterceptor
expressionResolutionFinished
in interface RecursionInterceptor
expression
- The expression to stop tracking.public void expressionResolutionStarted(String expression)
RecursionInterceptor
expressionResolutionStarted
in interface RecursionInterceptor
expression
- The expression to be resolved.public List getExpressionCycle(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
Copyright © 2019. All rights reserved.