Package org.mybatis.scripting.thymeleaf
Interface TemplateEngineCustomizer
- All Superinterfaces:
Consumer<org.thymeleaf.TemplateEngine>
- All Known Implementing Classes:
TemplateEngineCustomizer.BuiltIn
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface
public interface TemplateEngineCustomizer
extends Consumer<org.thymeleaf.TemplateEngine>
The interface for customizing a default
If you want to customize a default
e.g.) Implementation class:
e.g.) Configuration file (mybatis-thymeleaf.properties):
TemplateEngine instanced by the MyBatis Thymeleaf. If you want to customize a default
TemplateEngine, you implements class of this interface and you need to
specify the 'customizer' property of mybatis-thymeleaf.properties. e.g.) Implementation class:
package com.example;
// ...
public class MyTemplateEngineCustomizer implements TemplateEngineCustomizer {
public void customize(TemplateEngine defaultTemplateEngine) {
// ...
}
}
e.g.) Configuration file (mybatis-thymeleaf.properties):
customizer = com.example.MyTemplateEngineCustomizer
- Version:
- 1.0.0
- Author:
- Kazuki Shimizu
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumEnum for providing builtin customizer instance. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidaccept(org.thymeleaf.TemplateEngine templateEngine) voidcustomize(org.thymeleaf.TemplateEngine defaultTemplateEngine) Customize a defaultTemplateEngineinstanced by the MyBatis Thymeleaf.static <T extends org.thymeleaf.templateresolver.ITemplateResolver>
Optional<T> extractTemplateResolver(org.thymeleaf.TemplateEngine templateEngine, Class<T> type) Utility method to extract aITemplateResolverthat implements specified type.
-
Method Details
-
accept
default void accept(org.thymeleaf.TemplateEngine templateEngine) -
customize
void customize(org.thymeleaf.TemplateEngine defaultTemplateEngine) Customize a defaultTemplateEngineinstanced by the MyBatis Thymeleaf.- Parameters:
defaultTemplateEngine- a defaultTemplateEngineinstanced by the MyBatis Thymeleaf
-
extractTemplateResolver
static <T extends org.thymeleaf.templateresolver.ITemplateResolver> Optional<T> extractTemplateResolver(org.thymeleaf.TemplateEngine templateEngine, Class<T> type) Utility method to extract aITemplateResolverthat implements specified type.- Type Parameters:
T- A type that implements theITemplateResolver- Parameters:
templateEngine- A targetTemplateEnginetype- A target type for extracting instance- Returns:
- A
ITemplateResolverinstance that implements specified type
-