java.lang.Object
org.miaixz.bus.extra.template.provider.beetl.BeetlTemplate
- All Implemented Interfaces:
Serializable,Template
Beetl template implementation. This class wraps a Beetl
Template object, providing a unified
interface for rendering templates.- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBeetlTemplate(org.beetl.core.Template beetlTemplate) Constructs a newBeetlTemplateinstance. -
Method Summary
Modifier and TypeMethodDescriptionvoidrender(Map<?, ?> bindingMap, OutputStream out) Renders the template with the given binding parameters and writes the result to anOutputStream.voidRenders the template with the given binding parameters and writes the result to aWriter.static BeetlTemplatewrap(org.beetl.core.Template beetlTemplate) Wraps a Beetl template object into aBeetlTemplateinstance.
-
Constructor Details
-
BeetlTemplate
public BeetlTemplate(org.beetl.core.Template beetlTemplate) Constructs a newBeetlTemplateinstance.- Parameters:
beetlTemplate- The raw Beetl template object to be wrapped. Must not benull.
-
-
Method Details
-
wrap
Wraps a Beetl template object into aBeetlTemplateinstance.- Parameters:
beetlTemplate- The raw Beetl template object (Template).- Returns:
- A new
BeetlTemplateinstance, ornullif the inputbeetlTemplateisnull.
-
render
Description copied from interface:TemplateRenders the template with the given binding parameters and writes the result to aWriter. -
render
Description copied from interface:TemplateRenders the template with the given binding parameters and writes the result to anOutputStream.- Specified by:
renderin interfaceTemplate- Parameters:
bindingMap- A map of parameters to bind to the template variables.out- TheOutputStreamto which the rendered content will be written.
-