Interface Interpolator
-
- All Superinterfaces:
BasicInterpolator
- All Known Implementing Classes:
MultiDelimiterStringSearchInterpolator
,RegexBasedInterpolator
,StringSearchInterpolator
public interface Interpolator extends BasicInterpolator
Interpolator interface. Based on existing RegexBasedInterpolator interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPostProcessor(InterpolationPostProcessor postProcessor)
Add a new post-processor to handle final processing after recursively-interpolated value is determined.void
addValueSource(ValueSource valueSource)
Add a newValueSource
to the stack used to resolve expressions in this interpolator instance.void
clearAnswers()
void
clearFeedback()
Clear the feedback messages from previous interpolate(..) calls.java.util.List
getFeedback()
Return any feedback messages and errors that were generated - but suppressed - during the interpolation process.java.lang.String
interpolate(java.lang.String input, java.lang.String thisPrefixPattern)
java.lang.String
interpolate(java.lang.String input, java.lang.String thisPrefixPattern, RecursionInterceptor recursionInterceptor)
Attempt to resolve all expressions in the given input string, using the given pattern to first trim an optional prefix from each expression.boolean
isCacheAnswers()
void
removePostProcessor(InterpolationPostProcessor postProcessor)
Remove the given post-processor.void
removeValuesSource(ValueSource valueSource)
Remove the specifiedValueSource
from the stack used to resolve expressions in this interpolator instance.void
setCacheAnswers(boolean cacheAnswers)
-
Methods inherited from interface org.codehaus.plexus.interpolation.BasicInterpolator
interpolate, interpolate
-
-
-
-
Method Detail
-
addValueSource
void addValueSource(ValueSource valueSource)
Add a newValueSource
to the stack used to resolve expressions in this interpolator instance.- Parameters:
valueSource
-ValueSource
.
-
removeValuesSource
void removeValuesSource(ValueSource valueSource)
Remove the specifiedValueSource
from the stack used to resolve expressions in this interpolator instance.- Parameters:
valueSource
-ValueSource
.
-
addPostProcessor
void addPostProcessor(InterpolationPostProcessor postProcessor)
Add a new post-processor to handle final processing after recursively-interpolated value is determined.- Parameters:
postProcessor
-InterpolationPostProcessor
.
-
removePostProcessor
void removePostProcessor(InterpolationPostProcessor postProcessor)
Remove the given post-processor.- Parameters:
postProcessor
-InterpolationPostProcessor
.
-
interpolate
java.lang.String interpolate(java.lang.String input, java.lang.String thisPrefixPattern) throws InterpolationException
Seeinterpolate(String, String, RecursionInterceptor)
.This method triggers the use of a
SimpleRecursionInterceptor
instance for protection against expression cycles.- Parameters:
input
- The input string to interpolatethisPrefixPattern
- An optional pattern that should be trimmed from the start of any expressions found in the input.- Returns:
- interpolated string.
- Throws:
InterpolationException
- in case of an error.
-
interpolate
java.lang.String interpolate(java.lang.String input, java.lang.String thisPrefixPattern, RecursionInterceptor recursionInterceptor) throws InterpolationException
Attempt to resolve all expressions in the given input string, using the given pattern to first trim an optional prefix from each expression. The supplied recursion interceptor will provide protection from expression cycles, ensuring that the input can be resolved or an exception is thrown. return an empty String if input is null- Parameters:
input
- The input string to interpolatethisPrefixPattern
- An optional pattern that should be trimmed from the start of any expressions found in the input.recursionInterceptor
- Used to protect the interpolation process from expression cycles, and throw an exception if one is detected.- Returns:
- interpolated string.
- Throws:
InterpolationException
- in case of an error.
-
getFeedback
java.util.List getFeedback()
Return any feedback messages and errors that were generated - but suppressed - during the interpolation process. Since unresolvable expressions will be left in the source string as-is, this feedback is optional, and will only be useful for debugging interpolation problems.- Returns:
- a
List
that may be interspersed withString
andThrowable
instances.
-
clearFeedback
void clearFeedback()
Clear the feedback messages from previous interpolate(..) calls.
-
isCacheAnswers
boolean isCacheAnswers()
- Returns:
- state of the cacheAnswers
-
setCacheAnswers
void setCacheAnswers(boolean cacheAnswers)
- Parameters:
cacheAnswers
- true/false.
-
clearAnswers
void clearAnswers()
-
-