protected void generate(String templateText, Map<String, Object> binding, Writer out) {
   try {
     engine.createTemplate(templateText).make(binding).writeTo(out);
   } catch (ClassNotFoundException e) {
     throw new RuntimeException(e);
   } catch (IOException e) {
     throw new RuntimeException(e);
   }
 }
Esempio n. 2
0
  /** {@inheritDoc} */
  public Template createTemplate(Reader reader) throws IOException, TemplateCompilationException {
    Template template = null;

    try {
      template = new GroovyTemplate(this, groovyEngine.createTemplate(reader));
    } catch (GroovyRuntimeException e) {
      // Omvormen tot implementatie onafhankelijke fout.
      throw new TemplateCompilationException(e);
    }

    return template;
  }