Class VariableStringResolver
java.lang.Object
io.wcm.devops.conga.generator.util.VariableStringResolver
Resolve variables in a string referencing entries from a map.
-
Constructor Summary
ConstructorsConstructorDescriptionVariableStringResolver(ValueProviderGlobalContext valueProviderGlobalContext, VariableMapResolver variableMapResolver) -
Method Summary
Modifier and TypeMethodDescriptionDe-escapes all escaped variables in the given string.static booleanhasValueProviderReference(String value) Checks if the given string contains any reference to a variable from a value provider.Replace variable placeholders in a string with syntax ${key} with values from a map.Replace variable placeholders in a string with syntax ${key} with values from a map.resolveString(String value, Map<String, Object> variables) Replace variable placeholders in a string with syntax ${key} with values from a map.resolveString(String value, Map<String, Object> variables, boolean deescapeVariables) Replace variable placeholders in a string with syntax ${key} with values from a map.
-
Constructor Details
-
VariableStringResolver
public VariableStringResolver(ValueProviderGlobalContext valueProviderGlobalContext, VariableMapResolver variableMapResolver) - Parameters:
valueProviderGlobalContext- Value provider global contextvariableMapResolver- Variable map resolver
-
-
Method Details
-
resolveString
Replace variable placeholders in a string with syntax ${key} with values from a map. The variables can recursively reference each other. All escaped variables are deescaped.- Parameters:
value- Value with variable placeholdersvariables- Variable map- Returns:
- Value with variable placeholders resolved.
- Throws:
IllegalArgumentException- when a variable name could not be resolve.d
-
resolve
Replace variable placeholders in a string with syntax ${key} with values from a map. The variables can recursively reference each other. All escaped variables are deescaped.- Parameters:
value- Value with variable placeholdersvariables- Variable map- Returns:
- Value with variable placeholders resolved.
- Throws:
IllegalArgumentException- when a variable name could not be resolve.d
-
resolveString
Replace variable placeholders in a string with syntax ${key} with values from a map. The variables can recursively reference each other.- Parameters:
value- Value with variable placeholdersvariables- Variable mapdeescapeVariables- If true,deescape(String)is applied to the result string- Returns:
- Value with variable placeholders resolved.
- Throws:
IllegalArgumentException- when a variable name could not be resolve.d
-
resolve
Replace variable placeholders in a string with syntax ${key} with values from a map. The variables can recursively reference each other.- Parameters:
value- Value with variable placeholdersvariables- Variable mapdeescapeVariables- If true,deescape(String)is applied to the result string- Returns:
- Value with variable placeholders resolved.
- Throws:
IllegalArgumentException- when a variable name could not be resolve.d
-
deescape
De-escapes all escaped variables in the given string.- Parameters:
value- String that may contain escaped variable references (starting with \$)- Returns:
- String with de-escaped variable references.
-
hasValueProviderReference
Checks if the given string contains any reference to a variable from a value provider.- Parameters:
value- Value string- Returns:
- true if a value provider reference was found.
-