use of groovy.lang.Writable in project indy by Commonjava.
the class TemplatingEngine method render.
public String render(final String acceptHeader, final String templateKey, final Map<String, Object> params) throws IndyGroovyException {
final Template template = getTemplate(acceptHeader, templateKey);
final Writable output = template.make(params);
final StringWriter writer = new StringWriter();
try {
output.writeTo(writer);
} catch (final IOException e) {
throw new IndyGroovyException("Failed to render template: %s for addMetadata: %s. Reason: %s", e, templateKey, acceptHeader, e.getMessage());
}
return writer.toString();
}
Aggregations