Class MultiVariableExpander

    • Constructor Detail

      • MultiVariableExpander

        public MultiVariableExpander()
    • Method Detail

      • expand

        public String expand​(String param)
        Description copied from interface: VariableExpander
        Return the input string with any variables replaced by their corresponding value. If there are no variables in the string, then the input parameter is returned unaltered.
        Specified by:
        expand in interface VariableExpander
      • expand

        public String expand​(String str,
                             String marker,
                             Map<String,​Object> source)
        Replace any occurrences within the string of the form "marker{key}" with the value from source[key].

        Commonly, the variable marker is "$", in which case variables are indicated by ${key} in the string.

        Returns the string after performing all substitutions.

        If no substitutions were made, the input string object is returned (not a copy).

        Throws:
        IllegalArgumentException - if the input param references a variable which is not known to the specified source.