All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nh.micro.template.MicroServiceTemplateUtil Maven / Gradle / Ivy

There is a newer version: 1.2.9-RELEASE
Show 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.minxin.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 - 2024 Weber Informatics LLC | Privacy Policy