Java Map Replace replacePlaceholders(String script, Map configurations)

Here you can find the source of replacePlaceholders(String script, Map configurations)

Description

replace Placeholders

License

Apache License

Declaration

public static String replacePlaceholders(String script, Map<String, String> configurations) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Map;

public class Main {
    public static String replacePlaceholders(String script, Map<String, String> configurations) {
        for (Map.Entry<String, String> configuration : configurations.entrySet()) {
            script = script.replaceAll("\\$\\{" + configuration.getKey() + "\\}", configuration.getValue());
        }/* w w  w  .j ava2  s  .  c o  m*/
        return script;
    }
}

Related

  1. replaceParameters(final String value, final Map paramMap)
  2. replaceParameters(Map map, Map originals, Map defaults, Map hards)
  3. replaceParameters(String query, Map parameters)
  4. replaceParameters(String str, Map parameters)
  5. replaceParams(String str, Map map)
  6. replacePlaceholders(String string, Map values)
  7. replaceProperties(final CharSequence string, final Map properties)
  8. replaceQueryParameterInUrl(String fullUrl, Map newParameter)
  9. replaceSeparator(String value, String separator, Map map)