Java Map Substitute substituteSql(String template, Map map)

Here you can find the source of substituteSql(String template, Map map)

Description

substitute Sql

License

Open Source License

Declaration

public static String substituteSql(String template, Map<String, String> map) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Iterator;
import java.util.Map;

public class Main {
    public static String substituteSql(String template, Map<String, String> map) {
        Iterator<Map.Entry<String, String>> itMap = map.entrySet().iterator();

        while (itMap.hasNext()) {
            Map.Entry<String, String> entry = itMap.next();
            template = template.replace("{" + entry.getKey() + "}", "" + entry.getValue());
        }//from w w  w  . ja  v a2s  .  c o m
        return template;
    }
}

Related

  1. substitute(String str, Map subs)
  2. substitute(String str, Map subs)
  3. substituteExpressionLanguage(String stringToParse, Map variableMap)
  4. substituteForTokens(String input, Map tokenMap, boolean invertMap)
  5. substituteProfileProperty(String key, Map> configs)
  6. substituteTokens(String pattern, Map tokens)
  7. substituteTokens(String pattern, Map tokens)
  8. substituteUserConfiguration(String originalContent, Map paramAnchorTextAndValues)