Package juzu.template

Examples of juzu.template.TemplateRenderContext.render()


  public void render(String text, Map<String, Object> attributes, Locale locale, Appendable appendable) throws IOException, TemplateExecutionException, TemplateException {
    GroovyTemplateStub template = template(text);
    TemplateRenderContext renderContext = new TemplateRenderContext(template, null, attributes, locale);
    OutputStream adapter = OutputStream.create(Tools.UTF_8, appendable);
    renderContext.render(adapter);
    final AtomicReference<IOException> ios = new AtomicReference<IOException>();
    adapter.close(new Thread.UncaughtExceptionHandler() {
      public void uncaughtException(Thread t, Throwable e) {
        if (e instanceof IOException) {
          ios.set((IOException)e);
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.