Package org.mybatis.scripting.thymeleaf
Class SqlGeneratorConfig.TemplateFileConfig
java.lang.Object
org.mybatis.scripting.thymeleaf.SqlGeneratorConfig.TemplateFileConfig
- Direct Known Subclasses:
ThymeleafLanguageDriverConfig.TemplateFileConfig
- Enclosing class:
SqlGeneratorConfig
Template file configuration.
- Since:
- 1.0.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet the base directory for reading template resource file.Get the cache TTL(millisecond) for resolved templates.Get the character encoding for reading template resource file.String[]
Get patterns for reading as template resource file.boolean
Get whether use the cache feature when load template resource file.void
setBaseDir
(String baseDir) Set the base directory for reading template resource file.void
setCacheEnabled
(boolean cacheEnabled) Set whether use the cache feature when load template resource file.void
setCacheTtl
(Long cacheTtl) Set the cache TTL(millisecond) for resolved templates.void
setEncoding
(Charset encoding) Set the character encoding for reading template resource file.void
setPatterns
(String... patterns) Set patterns for reading as template resource file.
-
Constructor Details
-
TemplateFileConfig
public TemplateFileConfig()
-
-
Method Details
-
getEncoding
Get the character encoding for reading template resource file.Default is
UTF-8
.- Returns:
- the character encoding for reading template resource file
-
setEncoding
Set the character encoding for reading template resource file.- Parameters:
encoding
- the character encoding for reading template resource file
-
getBaseDir
Get the base directory for reading template resource file.Default is
""
(none).- Returns:
- the base directory for reading template resource file
-
setBaseDir
Set the base directory for reading template resource file.- Parameters:
baseDir
- the base directory for reading template resource file
-
getPatterns
Get patterns for reading as template resource file.Default is
"*.sql"
.- Returns:
- patterns for reading as template resource file
-
setPatterns
Set patterns for reading as template resource file.- Parameters:
patterns
- patterns for reading as template resource file
-
isCacheEnabled
public boolean isCacheEnabled()Get whether use the cache feature when load template resource file.Default is
true
.- Returns:
- If use th cache feature, return
true
-
setCacheEnabled
public void setCacheEnabled(boolean cacheEnabled) Set whether use the cache feature when load template resource file.- Parameters:
cacheEnabled
- If use th cache feature, settrue
-
getCacheTtl
Get the cache TTL(millisecond) for resolved templates.Default is
null
(indicate to use default value of Thymeleaf).- Returns:
- the cache TTL(millisecond) for resolved templates
-
setCacheTtl
Set the cache TTL(millisecond) for resolved templates.- Parameters:
cacheTtl
- the cache TTL(millisecond) for resolved templates
-