Package org.mybatis.scripting.thymeleaf
Class ThymeleafLanguageDriverConfig
java.lang.Object
org.mybatis.scripting.thymeleaf.SqlGeneratorConfig
org.mybatis.scripting.thymeleaf.ThymeleafLanguageDriverConfig
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Template file configuration for language driver of the MyBatis.Nested classes/interfaces inherited from class org.mybatis.scripting.thymeleaf.SqlGeneratorConfig
SqlGeneratorConfig.DialectConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet a template file configuration.Create an instance from default properties file.newInstance
(String resourcePath) Create an instance from specified properties file.newInstance
(Consumer<ThymeleafLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.newInstance
(Properties customProperties) Create an instance from specified properties.Methods inherited from class org.mybatis.scripting.thymeleaf.SqlGeneratorConfig
getCustomizer, getCustomizerInstance, getDialect, isUse2way, newInstanceWithCustomizer, newInstanceWithProperties, newInstanceWithResourcePath, setCustomizer, setCustomizerInstance, setUse2way
-
Constructor Details
-
ThymeleafLanguageDriverConfig
public ThymeleafLanguageDriverConfig()
-
-
Method Details
-
getTemplateFile
Description copied from class:SqlGeneratorConfig
Get a template file configuration.- Overrides:
getTemplateFile
in classSqlGeneratorConfig
- Returns:
- a template file configuration
-
newInstance
Create an instance from default properties file.
If you want to customize a defaultTemplateEngine
, you can configure some property using mybatis-thymeleaf.properties that encoded by UTF-8. Also, you can change the properties file that will read using system property (-Dmybatis-thymeleaf.config.file=... -Dmybatis-thymeleaf.config.encoding=...).
About supported common properties seeSqlGeneratorConfig.newInstance()
. Supported specific properties are as follows:Supported properties Property Key Description Default Template file path provider configuration(TemplateFilePathProvider) template-file.path-provider.prefix The prefix for adding to template file path ""
template-file.path-provider.includes-package-path Whether includes package path part true
template-file.path-provider.separate-directory-per-mapper Whether separate directory per mapper true
template-file.path-provider.includes-mapper-name-when-separate-directory Whether includes mapper name into file name when separate directory per mapper true
template-file.path-provider.cache-enabled Whether cache a resolved template file path true
- Returns:
- a configuration instance
- See Also:
-
newInstance
Create an instance from specified properties file.
you can configure some property using specified properties file that encoded by UTF-8. Also, you can change file encoding that will read using system property (-Dmybatis-thymeleaf.config.encoding=...).- Parameters:
resourcePath
- A property file resource path- Returns:
- a configuration instance
- See Also:
-
newInstance
Create an instance from specified properties.- Parameters:
customProperties
- custom configuration properties- Returns:
- a configuration instance
- See Also:
-
newInstance
public static ThymeleafLanguageDriverConfig newInstance(Consumer<ThymeleafLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.- Parameters:
customizer
- baseline customizer- Returns:
- a configuration instance
- See Also:
-