public class MultiDelimiterStringSearchInterpolator extends java.lang.Object implements Interpolator
| Modifier and Type | Field and Description |
|---|---|
private boolean |
cacheAnswers |
private java.util.LinkedHashSet<DelimiterSpecification> |
delimiters |
private java.lang.String |
escapeString |
private java.util.Map |
existingAnswers |
private static int |
MAX_TRIES |
private java.util.List |
postProcessors |
private java.util.List<ValueSource> |
valueSources |
| Constructor and Description |
|---|
MultiDelimiterStringSearchInterpolator() |
| Modifier and Type | Method and Description |
|---|---|
MultiDelimiterStringSearchInterpolator |
addDelimiterSpec(java.lang.String delimiterSpec) |
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 new
ValueSource to the stack used to resolve expressions
in this interpolator instance. |
void |
clearAnswers() |
void |
clearFeedback()
Clear the feedback messages from previous interpolate(..) calls.
|
java.lang.String |
getEscapeString() |
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 |
interpolate(java.lang.String input,
RecursionInterceptor recursionInterceptor)
Entry point for recursive resolution of an expression and all of its nested expressions.
|
private java.lang.String |
interpolate(java.lang.String input,
RecursionInterceptor recursionInterceptor,
java.util.Set<java.lang.String> unresolvable) |
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() |
boolean |
removeDelimiterSpec(java.lang.String delimiterSpec) |
void |
removePostProcessor(InterpolationPostProcessor postProcessor)
Remove the given post-processor.
|
void |
removeValuesSource(ValueSource valueSource)
Remove the specified
ValueSource from the stack used to resolve
expressions in this interpolator instance. |
private DelimiterSpecification |
select(java.lang.String input,
int lastEndIdx) |
void |
setCacheAnswers(boolean cacheAnswers) |
MultiDelimiterStringSearchInterpolator |
setDelimiterSpecs(java.util.LinkedHashSet<java.lang.String> specs) |
void |
setEscapeString(java.lang.String escapeString) |
MultiDelimiterStringSearchInterpolator |
withPostProcessor(InterpolationPostProcessor postProcessor) |
MultiDelimiterStringSearchInterpolator |
withValueSource(ValueSource vs) |
private static final int MAX_TRIES
private java.util.Map existingAnswers
private java.util.List<ValueSource> valueSources
private java.util.List postProcessors
private boolean cacheAnswers
private java.util.LinkedHashSet<DelimiterSpecification> delimiters
private java.lang.String escapeString
public MultiDelimiterStringSearchInterpolator()
public MultiDelimiterStringSearchInterpolator addDelimiterSpec(java.lang.String delimiterSpec)
public boolean removeDelimiterSpec(java.lang.String delimiterSpec)
public MultiDelimiterStringSearchInterpolator withValueSource(ValueSource vs)
public MultiDelimiterStringSearchInterpolator withPostProcessor(InterpolationPostProcessor postProcessor)
public void addValueSource(ValueSource valueSource)
ValueSource to the stack used to resolve expressions
in this interpolator instance.addValueSource in interface Interpolatorpublic void removeValuesSource(ValueSource valueSource)
ValueSource from the stack used to resolve
expressions in this interpolator instance.removeValuesSource in interface Interpolatorpublic void addPostProcessor(InterpolationPostProcessor postProcessor)
addPostProcessor in interface Interpolatorpublic void removePostProcessor(InterpolationPostProcessor postProcessor)
removePostProcessor in interface Interpolatorpublic java.lang.String interpolate(java.lang.String input,
java.lang.String thisPrefixPattern)
throws InterpolationException
InterpolatorInterpolator.interpolate(String, String, RecursionInterceptor).
SimpleRecursionInterceptor
instance for protection against expression cycles.interpolate in interface Interpolatorinput - The input string to interpolatethisPrefixPattern - An optional pattern that should be trimmed from
the start of any expressions found in the input.InterpolationExceptionpublic java.lang.String interpolate(java.lang.String input,
java.lang.String thisPrefixPattern,
RecursionInterceptor recursionInterceptor)
throws InterpolationException
Interpolatorinterpolate in interface Interpolatorinput - 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.InterpolationExceptionpublic java.lang.String interpolate(java.lang.String input)
throws InterpolationException
BasicInterpolatorInterpolator.interpolate(String, String, org.codehaus.plexus.interpolation.RecursionInterceptor).
SimpleRecursionInterceptor
instance for protection against expression cycles. It also leaves empty the
expression prefix which would otherwise be trimmed from expressions. The
result is that any detected expression will be resolved as-is.interpolate in interface BasicInterpolatorinput - The input string to interpolateInterpolationExceptionpublic java.lang.String interpolate(java.lang.String input,
RecursionInterceptor recursionInterceptor)
throws InterpolationException
interpolate in interface BasicInterpolatorinput - The input string to interpolaterecursionInterceptor - Used to protect the interpolation process
from expression cycles, and throw an
exception if one is detected.InterpolationExceptionprivate java.lang.String interpolate(java.lang.String input,
RecursionInterceptor recursionInterceptor,
java.util.Set<java.lang.String> unresolvable)
throws InterpolationException
InterpolationExceptionprivate DelimiterSpecification select(java.lang.String input, int lastEndIdx)
public java.util.List getFeedback()
getFeedback in interface InterpolatorList that may be interspersed with String and Throwable instances.public void clearFeedback()
clearFeedback in interface Interpolatorpublic boolean isCacheAnswers()
isCacheAnswers in interface Interpolatorpublic void setCacheAnswers(boolean cacheAnswers)
setCacheAnswers in interface Interpolatorpublic void clearAnswers()
clearAnswers in interface Interpolatorpublic java.lang.String getEscapeString()
public void setEscapeString(java.lang.String escapeString)
public MultiDelimiterStringSearchInterpolator setDelimiterSpecs(java.util.LinkedHashSet<java.lang.String> specs)