Search in sources :

Example 1 with LazyProcessingCharSequence

use of org.thymeleaf.util.LazyProcessingCharSequence in project thymeleaf by thymeleaf.

the class AbstractStandardInliner method inlineSwitchTemplateMode.

private CharSequence inlineSwitchTemplateMode(final ITemplateContext context, final IText text) {
    final TemplateManager templateManager = context.getConfiguration().getTemplateManager();
    final TemplateModel templateModel = templateManager.parseString(context.getTemplateData(), text.getText(), text.getLine(), text.getCol(), this.templateMode, true);
    if (!this.writeTextsToOutput) {
        final Writer stringWriter = new FastStringWriter(50);
        templateManager.process(templateModel, context, stringWriter);
        return stringWriter.toString();
    }
    // If we can directly write to output (and text is an IText), we will use a LazyProcessingCharSequence
    return new LazyProcessingCharSequence(context, templateModel);
}
Also used : LazyProcessingCharSequence(org.thymeleaf.util.LazyProcessingCharSequence) FastStringWriter(org.thymeleaf.util.FastStringWriter) TemplateManager(org.thymeleaf.engine.TemplateManager) TemplateModel(org.thymeleaf.engine.TemplateModel) FastStringWriter(org.thymeleaf.util.FastStringWriter) Writer(java.io.Writer)

Aggregations

Writer (java.io.Writer)1 TemplateManager (org.thymeleaf.engine.TemplateManager)1 TemplateModel (org.thymeleaf.engine.TemplateModel)1 FastStringWriter (org.thymeleaf.util.FastStringWriter)1 LazyProcessingCharSequence (org.thymeleaf.util.LazyProcessingCharSequence)1