Class ThymeleafTemplate

java.lang.Object
org.miaixz.bus.extra.template.provider.thymeleaf.ThymeleafTemplate
All Implemented Interfaces:
Serializable, Template

public class ThymeleafTemplate extends Object implements Template, Serializable
Thymeleaf模板实现
Since:
Java 17+
Author:
Kimi Liu
See Also:
  • Constructor Details

    • ThymeleafTemplate

      public ThymeleafTemplate(org.thymeleaf.TemplateEngine engine, String template, Charset charset)
      构造
      Parameters:
      engine - Thymeleaf的模板对象 TemplateEngine
      template - 模板路径或模板内容
      charset - 编码
  • Method Details

    • wrap

      public static ThymeleafTemplate wrap(org.thymeleaf.TemplateEngine engine, String template, Charset charset)
      包装Thymeleaf模板
      Parameters:
      engine - Thymeleaf的模板引擎对象 TemplateEngine
      template - 模板路径或模板内容
      charset - 编码
      Returns:
      ThymeleafTemplate
    • render

      public void render(Map<?,?> bindingMap, Writer writer)
      Description copied from interface: Template
      将模板与绑定参数融合后输出到Writer
      Specified by:
      render in interface Template
      Parameters:
      bindingMap - 绑定的参数,此Map中的参数会替换模板中的变量
      writer - 输出
    • render

      public void render(Map<?,?> bindingMap, OutputStream out)
      Description copied from interface: Template
      将模板与绑定参数融合后输出到流
      Specified by:
      render in interface Template
      Parameters:
      bindingMap - 绑定的参数,此Map中的参数会替换模板中的变量
      out - 输出