public class TemplateString extends Object
Provides functionality for replacing variables in a templatized string. It can also be used to get the place-holders (variables) in a templatized string.
This API is experimental and may change in the future.Constructor and Description |
---|
TemplateString() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
getVariables(String s)
Returns the variables in the given string.
|
String |
replaceTokens(String string,
VariableResolver resolver)
Returns a string with all variables replaced by the known values.
|
public String replaceTokens(String string, VariableResolver resolver)
string
- the String to be resolvedresolver
- the VariableResolver instance to be used for evaluation