Package org.thymeleaf.templatewriter

Examples of org.thymeleaf.templatewriter.ITemplateWriter


    log.debug("Caching element {}", cacheName);

    String templateMode = arguments.getTemplateResolution().getTemplateMode();

    final ITemplateModeHandler templateModeHandler = arguments.getConfiguration().getTemplateModeHandler(templateMode);
    final ITemplateWriter templateWriter = templateModeHandler.getTemplateWriter();

    if (templateWriter == null) {
      throw new ConfigurationException("No template writer defined for template mode \"" + templateMode + "\"");
    } else if (!AbstractGeneralTemplateWriter.class.isAssignableFrom(templateWriter.getClass())) {
      throw new ConfigurationException("The template writer defined for template mode \"" + templateMode
          + "\" is not an AbstractGeneralTemplateWriter");
    }

    StringWriter writer = new StringWriter();
View Full Code Here


                    new Object[] { TemplateEngine.threadIndex(), templateName, templateMode });
        }
       
        final ITemplateModeHandler templateModeHandler =
                this.configuration.getTemplateModeHandler(templateMode);
        final ITemplateWriter templateWriter = templateModeHandler.getTemplateWriter();

        if (templateWriter == null) {
            throw new ConfigurationException(
                    "No template writer defined for template mode \"" + templateMode + "\"");
        }
       
        try {
            // It depends on the ITemplateWriter implementation to allow nulls or not.
            // Standard writer will simply not write anything for null.
            templateWriter.write(arguments, writer, document);
        } catch (IOException e) {
            throw new TemplateOutputException("Error during creation of output", e);
        }
   
    }
View Full Code Here

    log.debug("Caching element {}", cacheName);

    String templateMode = arguments.getTemplateResolution().getTemplateMode();

    final ITemplateModeHandler templateModeHandler = arguments.getConfiguration().getTemplateModeHandler(templateMode);
    final ITemplateWriter templateWriter = templateModeHandler.getTemplateWriter();

    if (templateWriter == null) {
      throw new ConfigurationException("No template writer defined for template mode \"" + templateMode + "\"");
    } else if (!AbstractGeneralTemplateWriter.class.isAssignableFrom(templateWriter.getClass())) {
      throw new ConfigurationException("The template writer defined for template mode \"" + templateMode
          + "\" is not an AbstractGeneralTemplateWriter");
    }

    StringWriter writer = new StringWriter();
View Full Code Here

TOP

Related Classes of org.thymeleaf.templatewriter.ITemplateWriter

Copyright © 2018 www.massapicom. 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.