public static String render(JadeTemplate template, Map<String, Object> model, boolean pretty) throws JadeCompilerException { template.setPrettyPrint(pretty); return templateToString(template, model); }
public static String render(String filename, Map<String, Object> model, boolean pretty) throws IOException, JadeCompilerException { JadeTemplate template = getTemplate(filename); template.setPrettyPrint(pretty); return templateToString(template, model); }
public static void render(JadeTemplate template, Map<String, Object> model, Writer writer, boolean pretty) throws JadeCompilerException { template.setPrettyPrint(pretty); template.process(new JadeModel(model), writer); }
public static void render(String filename, Map<String, Object> model, Writer writer, boolean pretty) throws IOException, JadeCompilerException { JadeTemplate template = getTemplate(filename); template.setPrettyPrint(pretty); template.process(new JadeModel(model), writer); }
private JadeTemplate createTemplate(String name) throws JadeException, IOException { JadeTemplate template = new JadeTemplate(); Parser parser = new Parser(name, basePath, templateLoader, expressionHandler); Node root = parser.parse(); template.setTemplateLoader(templateLoader); template.setExpressionHandler(expressionHandler); template.setRootNode(root); template.setPrettyPrint(prettyPrint); template.setMode(getMode()); return template; }
public static String render(JadeTemplate template, Map<String, Object> model, boolean pretty) throws JadeCompilerException { template.setPrettyPrint(pretty); return templateToString(template, model); }
public static String render(String filename, Map<String, Object> model, boolean pretty) throws IOException, JadeCompilerException { JadeTemplate template = getTemplate(filename); template.setPrettyPrint(pretty); return templateToString(template, model); }
public static void render(JadeTemplate template, Map<String, Object> model, Writer writer, boolean pretty) throws JadeCompilerException { template.setPrettyPrint(pretty); template.process(new JadeModel(model), writer); }
protected JadeTemplate getTemplate(Class<?> containerClass) throws IOException { String templateName = containerClass.getName(); String resourceName = containerClass.getSimpleName() + ".jade"; InputStream inputStream = containerClass.getResourceAsStream(resourceName); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream)); JadeTemplate template = new JadeTemplate(); TemplateLoader templateLoader = new ReaderTemplateLoader(reader, templateName); Parser parser = new Parser(templateName, templateLoader); Node root = parser.parse(); template.setTemplateLoader(templateLoader); template.setRootNode(root); template.setPrettyPrint(true); return template; }
public static void render(String filename, Map<String, Object> model, Writer writer, boolean pretty) throws IOException, JadeCompilerException { JadeTemplate template = getTemplate(filename); template.setPrettyPrint(pretty); template.process(new JadeModel(model), writer); }
private JadeTemplate createTemplate(String name) throws JadeException, IOException { JadeTemplate template = new JadeTemplate(); Parser parser = new Parser(name, basePath, templateLoader, expressionHandler); Node root = parser.parse(); template.setTemplateLoader(templateLoader); template.setExpressionHandler(expressionHandler); template.setRootNode(root); template.setPrettyPrint(prettyPrint); template.setMode(getMode()); return template; }