- java.lang.Object
-
- com.pervasive.datarush.commons.util.VariableExpander
-
public final class VariableExpander extends Object
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
Constructors Constructor Description VariableExpander()
Creates 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
expand(String str)
Expands the macros in the given string.void
put(String variable, String value)
Adds a new variable
-
-
-
Constructor Detail
-
VariableExpander
public VariableExpander()
Creates an empty variable expander.
-
VariableExpander
public VariableExpander(Map<String,String> map)
Creates a variable expander, initialized to the given map.- Parameters:
map
- the map of variables
-
VariableExpander
public VariableExpander(Properties variables)
Creates a variable expander, initialized to the given properties object.- Parameters:
variables
- the map of variables
-
-