java.lang.Object
com.pervasive.datarush.commons.util.VariableExpander
Variable expander that knows how to expand simple macro expressions of the
form "${variableName}". Literal "$" can be escaped via the escape character
"\". VariableExpanders are provided a map of macros to values. Values not in
the map will not be expanded.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty variable expander.VariableExpander(Map<String, String> map) Creates a variable expander, initialized to the given map.VariableExpander(Properties variables) Creates a variable expander, initialized to the given properties object. -
Method Summary
-
Constructor Details
-
VariableExpander
public VariableExpander()Creates an empty variable expander. -
VariableExpander
Creates a variable expander, initialized to the given map.- Parameters:
map- the map of variables
-
VariableExpander
Creates a variable expander, initialized to the given properties object.- Parameters:
variables- the map of variables
-
-
Method Details
-
put
Adds a new variable- Parameters:
variable- the variable to addvalue- the value of the variable
-
expand
Expands the macros in the given string.- Parameters:
str- the string- Returns:
- the string with the macros expanded.
-