public class StrSubstitutor
| Constructor and description |
|---|
StrSubstitutor
() |
StrSubstitutor
(Map<String, Object> variables) |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public String |
replace(String str)Use GStringTemplateEngine to convert a template string into a string with variable values. |
|
public String |
replaceUsingSimpleSubstitutor(String str) |
|
public static String |
resolveEnvVars(String str, Map<String, String> envMap)Resolves ${env.VAR} placeholders in the given string using the
supplied environment-variable map, without permanently modifying any stored value. |
Use GStringTemplateEngine to convert a template string into a string with variable values.
str - A template string Resolves ${env.VAR} placeholders in the given string using the
supplied environment-variable map, without permanently modifying any stored value.
The caller is responsible for building envMap — including any
shell-sourced variables (e.g. from printenv) that are not visible to
the JVM — so that all expected placeholders can be resolved.
Returns str unchanged if it contains no ${env.} expression.
str - the string possibly containing \${env.VAR} placeholdersenvMap - a map of environment-variable name to value\${env.VAR} placeholders replaced