- All Superinterfaces:
org.miaixz.bus.core.Provider,Serializable,org.miaixz.bus.core.lang.Wrapper<Object>
- All Known Implementing Classes:
BeetlProvider,FreemarkerProvider,ThymeleafProvider
Interface for template engine providers. Implementations of this interface wrap specific template engines, providing
a unified way to initialize and retrieve templates.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptiongetTemplate(String resource) Retrieves aTemplateobject based on the provided resource.init(TemplateConfig config) Initializes the template engine with the specified configuration.Methods inherited from interface org.miaixz.bus.core.lang.Wrapper
getRaw, type
-
Method Details
-
init
Initializes the template engine with the specified configuration.- Parameters:
config- TheTemplateConfigcontaining initialization parameters for the template engine.- Returns:
- This
TemplateProviderinstance, initialized with the given configuration.
-
getTemplate
Retrieves aTemplateobject based on the provided resource. The interpretation of the resource string depends on the specific template engine implementation; it could be the template content itself or a relative path to the template file.- Parameters:
resource- The resource identifier for the template.- Returns:
- A
Templateinstance ready for rendering.
-