com.ktanx.autocoder.task.EnjoyRenderHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ktanx-autocoder Show documentation
Show all versions of ktanx-autocoder Show documentation
ktanx-autocoder is a java code generate kit.
The newest version!
package com.ktanx.autocoder.task;
import com.jfinal.template.Engine;
import com.jfinal.template.Template;
import com.jfinal.template.source.ClassPathSourceFactory;
import java.util.Map;
public class EnjoyRenderHandler implements RenderHandler {
private static final Engine engine = Engine.create("autocoder");
public EnjoyRenderHandler() {
engine.setSourceFactory(new ClassPathSourceFactory());
}
@Override
public String renderToString(String template, Map context) {
Template temp = engine.getTemplate(template);
String text = temp.renderToString(context);
return text;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy