Package groovy.text

Examples of groovy.text.Template.make()


            log("Making template \"" + name + "\"...");
        }
        // String made = template.make(binding.getVariables()).toString();
        // log(" = " + made);
        long makeMillis = System.currentTimeMillis();
        template.make(binding.getVariables()).writeTo(out);
        makeMillis = System.currentTimeMillis() - makeMillis;

        if (generateBy) {
            StringBuffer sb = new StringBuffer(100);
            sb.append("\n<!-- Generated by Groovy TemplateServlet [create/get=");
View Full Code Here


        classTemplates.put(templatePath, t);
      }
      Map binding = new HashMap();
          binding.put("classDoc", classDoc);
         
          templateWithBindingApplied = t.make(binding).toString();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return templateWithBindingApplied;
  }
View Full Code Here

      }

      Map binding = new HashMap();
          binding.put("packageDoc", packageDoc);
         
          templateWithBindingApplied = t.make(binding).toString();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return templateWithBindingApplied;
  }
View Full Code Here

      }

      Map binding = new HashMap();
          binding.put("rootDoc", rootDoc);
         
          templateWithBindingApplied = t.make(binding).toString();
    } catch (Exception e) {
      e.printStackTrace();
    }
    return templateWithBindingApplied;
  }
View Full Code Here

        try {
            Template template = engine.createTemplate(scriptSource);
            if (template instanceof GroovyPageTemplate) {
                ((GroovyPageTemplate)template).setAllowSettingContentType(true);
            }
            template.make().writeTo(out);
        }
        catch(Exception e) {
            out.setError();
            throw e;
        }
View Full Code Here

  @Override
  protected void renderMergedTemplateModel(Map<String, Object> model,
      HttpServletRequest request, HttpServletResponse response) throws Exception {

    Template template = getTemplate(getUrl());
    template.make(model).writeTo(new BufferedWriter(response.getWriter()));
  }

  /**
   * Return a template compiled by the configured Groovy Markup template engine
   * for the given view URL.
View Full Code Here

            log("Making template \"" + name + "\"...");
        }
        // String made = template.make(binding.getVariables()).toString();
        // log(" = " + made);
        long makeMillis = System.currentTimeMillis();
        template.make(binding.getVariables()).writeTo(out);
        makeMillis = System.currentTimeMillis() - makeMillis;

        if (generateBy) {
            StringBuilder sb = new StringBuilder(100);
            sb.append("\n<!-- Generated by Groovy TemplateServlet [create/get=");
View Full Code Here

                classTemplates.put(templatePath, t);
            }
            Map<String, Object> binding = new HashMap<String, Object>();
            binding.put("classDoc", classDoc);
            binding.put("props", properties);
            templateWithBindingApplied = t.make(binding).toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return templateWithBindingApplied;
    }
View Full Code Here

                packageTemplates.put(template, t);
            }
            Map<String, Object> binding = new HashMap<String, Object>();
            binding.put("packageDoc", packageDoc);
            binding.put("props", properties);
            templateWithBindingApplied = t.make(binding).toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return templateWithBindingApplied;
    }
View Full Code Here

                docTemplates.put(template, t);
            }
            Map<String, Object> binding = new HashMap<String, Object>();
            binding.put("rootDoc", rootDoc);
            binding.put("props", properties);
            templateWithBindingApplied = t.make(binding).toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return templateWithBindingApplied;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.