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 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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Enum for providing builtin customizer instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    accept(org.thymeleaf.TemplateEngine templateEngine)
    void
    customize(org.thymeleaf.TemplateEngine defaultTemplateEngine)
    Customize a default TemplateEngine 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 a ITemplateResolver that implements specified type.

    Methods inherited from interface java.util.function.Consumer

    andThen
  • Method Details

    • accept

      default void accept(org.thymeleaf.TemplateEngine templateEngine)
      Specified by:
      accept in interface Consumer<org.thymeleaf.TemplateEngine>
      See Also:
    • customize

      void customize(org.thymeleaf.TemplateEngine defaultTemplateEngine)
      Customize a default TemplateEngine instanced by the MyBatis Thymeleaf.
      Parameters:
      defaultTemplateEngine - a default TemplateEngine 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 a ITemplateResolver that implements specified type.
      Type Parameters:
      T - A type that implements the ITemplateResolver
      Parameters:
      templateEngine - A target TemplateEngine
      type - A target type for extracting instance
      Returns:
      A ITemplateResolver instance that implements specified type