public class VariableSubstitutor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
SUBSITUTE_PREFIX |
static String |
SUBSITUTE_PREFIX_SIMPLE |
static String |
SUBSTITUTE_SUFFIX |
Modifier and Type | Method and Description |
---|---|
static StrSubstitutor |
buildSubstitutor(Map<? extends Serializable,? extends Serializable> variables) |
static Map<String,String> |
filterAndUpdate(Map<String,String> input,
Map<String,? extends Serializable> variables)
Replaces variables in
input map values using keys defined in variables map. |
static void |
filterAndUpdate(Script<?> script,
Map<? extends Serializable,? extends Serializable> variables)
Filters the specified script object.
|
static String |
filterAndUpdate(String input,
Map<? extends Serializable,? extends Serializable> variables)
Filters the specified string and replaces the variables with values
specified in the map.
|
static Map<String,Serializable> |
resolveVariables(Map<String,Serializable> variables,
Map<String,Serializable> dictionary)
Creates a HashMap with variablesDictionary where values are resolved.
|
public static final String SUBSITUTE_PREFIX
public static final String SUBSITUTE_PREFIX_SIMPLE
public static final String SUBSTITUTE_SUFFIX
public static Map<String,String> filterAndUpdate(Map<String,String> input, Map<String,? extends Serializable> variables)
input
map values using keys defined in variables
map.input
- a map that may contain values to replace.variables
- a map which contains variable name and value pairs.public static Map<String,Serializable> resolveVariables(Map<String,Serializable> variables, Map<String,Serializable> dictionary)
variables
- input hash containing variables and their values may reference other variablespublic static String filterAndUpdate(String input, Map<? extends Serializable,? extends Serializable> variables)
input
- the string which need to be filteredvariables
- a map which contains variable valuesfilterAndUpdate(String, Map)
public static void filterAndUpdate(Script<?> script, Map<? extends Serializable,? extends Serializable> variables)
script
- the script to filtervariables
- a map which contains variables valuespublic static StrSubstitutor buildSubstitutor(Map<? extends Serializable,? extends Serializable> variables)