public class TextReplacement
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
TextReplacement.TextResolver
Used during the TextReplacement to dynamically resolve the input string with a value.
|
Constructor and Description |
---|
TextReplacement(java.util.regex.Pattern pat,
TextReplacement.TextResolver resolver)
Creates a TextReplacement for the given regular expression and resolver.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
doReplacements(java.lang.String in)
For the given input string, like, 'fielda=${val1} and fieldb=${val2}', do the variable replacements
using the regular expression and resolver that was passed in the contructor
|
static TextReplacement |
newColonTextReplacement(TextReplacement.TextResolver resolver)
Creates a
TextReplacement for :VARNAME type of variables |
static TextReplacement |
newDollarTextReplacement(TextReplacement.TextResolver resolver)
Creates a
TextReplacement for ${VARNAME} type of variables |
public TextReplacement(java.util.regex.Pattern pat, TextReplacement.TextResolver resolver)
pat
- resolver
- public java.lang.String doReplacements(java.lang.String in)
in
- public static TextReplacement newDollarTextReplacement(TextReplacement.TextResolver resolver)
TextReplacement
for ${VARNAME} type of variablesresolver
- public static TextReplacement newColonTextReplacement(TextReplacement.TextResolver resolver)
TextReplacement
for :VARNAME type of variablesresolver
-