
com.nh.micro.template.MicroServiceTemplateUtil Maven / Gradle / Ivy
The newest version!
package com.nh.micro.template;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
public class MicroServiceTemplateUtil {
public static String sqlTemplateService(String template,Map paramMap,List placeList){
VelocityEngine ve = new VelocityEngine();
ve.addProperty("userdirective", "com.nh.micro.template.vext.MicroSqlReplace");
ve.init();
VelocityContext context = new VelocityContext();
context.put("param", paramMap);
context.put("placeList", placeList);
StringWriter writer = new StringWriter();
ve.evaluate(context, writer, "", template);
return writer.toString();
}
public static String sqlTemplateService(String template,Map paramMap){
return sqlTemplateService(template,paramMap,new ArrayList());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy