Пример #1
0
        public static void render(String filename, Dictionary <String, Object> model, TextWriter writer, bool pretty)
        // throws IOException,JadeCompilerException
        {
            JadeTemplate template = getTemplate(filename);

            template.setPrettyPrint(pretty);
            template.process(new JadeModel(model), writer);
        }
Пример #2
0
        public static String render(String filename, Dictionary <String, Object> model, bool pretty)
        // throws IOException, JadeCompilerException
        {
            JadeTemplate template = getTemplate(filename);

            template.setPrettyPrint(pretty);
            return(templateToString(template, model));
        }
Пример #3
0
        private JadeTemplate createTemplate(String name)
        //throws JadeException, IOException
        {
            JadeTemplate template = new JadeTemplate();

            JadeParser parser = new JadeParser(name, templateLoader);
            Node       root   = parser.parse();

            template.setTemplateLoader(templateLoader);
            template.setRootNode(root);
            template.setPrettyPrint(prettyPrint);
            template.setMode(getMode());
            return(template);
        }
Пример #4
0
 public static String render(JadeTemplate template, Dictionary <String, Object> model, bool pretty)
 // throws JadeCompilerException
 {
     template.setPrettyPrint(pretty);
     return(templateToString(template, model));
 }
Пример #5
0
 // throws JadeCompilerException
 public static void render(JadeTemplate template, Dictionary<String, Object> model, TextWriter writer, bool pretty)
 {
     template.setPrettyPrint(pretty);
     template.process(new JadeModel(model), writer);
 }
Пример #6
0
 // throws JadeCompilerException
 public static String render(JadeTemplate template, Dictionary<String, Object> model, bool pretty)
 {
     template.setPrettyPrint(pretty);
     return templateToString(template, model);
 }
Пример #7
0
        //throws JadeException, IOException
        private JadeTemplate createTemplate(String name)
        {
            JadeTemplate template = new JadeTemplate();

            JadeParser parser = new JadeParser(name, templateLoader);
            Node root = parser.parse();
            template.setTemplateLoader(templateLoader);
            template.setRootNode(root);
            template.setPrettyPrint(prettyPrint);
            template.setMode(getMode());
            return template;
        }