Here you can find the source of replacePlaceholders(String script, Map
public static String replacePlaceholders(String script, Map<String, String> configurations)
//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; } }