java.lang.Object
org.miaixz.bus.extra.template.TemplateKit
Provides template utility methods for quick template merging and rendering.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic TemplateProviderRetrieves a singleton instance of the template engine.static StringRenders the given template content with the provided binding parameters and returns the result as a string.static voidRenders the given template content with the provided binding parameters and writes the result to aWriter.
-
Constructor Details
-
TemplateKit
public TemplateKit()
-
-
Method Details
-
getEngine
Retrieves a singleton instance of the template engine.- Returns:
- The singleton
TemplateProviderinstance.
-
render
Renders the given template content with the provided binding parameters and returns the result as a string.- Parameters:
templateContent- The template content to be rendered.bindingMap- A map of parameters to bind to the template variables.- Returns:
- The rendered content as a
String.
-
render
Renders the given template content with the provided binding parameters and writes the result to aWriter.- Parameters:
templateContent- The template content to be rendered.bindingMap- A map of parameters to bind to the template variables.writer- TheWriterto which the rendered content will be written.
-