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
Modifier and TypeInterfaceDescriptionstatic enum
Enum for providing builtin customizer instance. -
Method Summary
Modifier and TypeMethodDescriptiondefault void
accept
(org.thymeleaf.TemplateEngine templateEngine) void
customize
(org.thymeleaf.TemplateEngine defaultTemplateEngine) Customize a defaultTemplateEngine
instanced 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 aITemplateResolver
that implements specified type.
-
Method Details
-
accept
-
customize
void customize(org.thymeleaf.TemplateEngine defaultTemplateEngine) Customize a defaultTemplateEngine
instanced by the MyBatis Thymeleaf.- Parameters:
defaultTemplateEngine
- a defaultTemplateEngine
instanced 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 aITemplateResolver
that implements specified type.- Type Parameters:
T
- A type that implements theITemplateResolver
- Parameters:
templateEngine
- A targetTemplateEngine
type
- A target type for extracting instance- Returns:
- A
ITemplateResolver
instance that implements specified type
-