public class StringSearchInterpolator extends Object implements Interpolator
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_END_EXPR |
static String |
DEFAULT_START_EXPR |
| Constructor and Description |
|---|
StringSearchInterpolator() |
StringSearchInterpolator(String startExpr,
String endExpr) |
| Modifier and Type | Method and 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 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.
|
String |
getEscapeString() |
List |
getFeedback()
Return any feedback messages and errors that were generated - but
suppressed - during the interpolation process.
|
String |
interpolate(String input)
|
String |
interpolate(String input,
RecursionInterceptor recursionInterceptor)
Entry point for recursive resolution of an expression and all of its
nested expressions.
|
String |
interpolate(String input,
String thisPrefixPattern)
|
String |
interpolate(String input,
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 specified
ValueSource from the stack used to resolve
expressions in this interpolator instance. |
void |
setCacheAnswers(boolean cacheAnswers) |
void |
setEscapeString(String escapeString) |
public static final String DEFAULT_START_EXPR
public static final String DEFAULT_END_EXPR
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 String interpolate(String input, 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 String interpolate(String input, 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 String interpolate(String input) throws InterpolationException
InterpolatorInterpolator.interpolate(String, String, 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 Interpolatorinput - The input string to interpolateInterpolationExceptionpublic String interpolate(String input, RecursionInterceptor recursionInterceptor) throws InterpolationException
interpolate in interface Interpolatorinput - The input string to interpolaterecursionInterceptor - Used to protect the interpolation process
from expression cycles, and throw an
exception if one is detected.InterpolationExceptionpublic 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 String getEscapeString()
public void setEscapeString(String escapeString)
Copyright © 2001-2013 Codehaus. All Rights Reserved.