Package org.mybatis.scripting.freemarker
Class FreeMarkerLanguageDriverConfig
java.lang.Object
org.mybatis.scripting.freemarker.FreeMarkerLanguageDriverConfig
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Template file configuration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Get FreeMarker settings.Get a template file configuration.Create an instance from default properties file.newInstance
(Consumer<FreeMarkerLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.newInstance
(Properties customProperties) Create an instance from specified properties.void
setBasePackage
(String basePackage) Deprecated.Recommend to use theFreeMarkerLanguageDriverConfig.TemplateFileConfig.setBaseDir(String)
because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)
-
Constructor Details
-
FreeMarkerLanguageDriverConfig
public FreeMarkerLanguageDriverConfig()
-
-
Method Details
-
getFreemarkerSettings
-
getBasePackage
Deprecated.Recommend to use theFreeMarkerLanguageDriverConfig.TemplateFileConfig.getBaseDir()
} because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)Get a base directory for reading template resources.Default is none (just under classpath).
- Returns:
- a base directory for reading template resources
-
setBasePackage
Deprecated.Recommend to use theFreeMarkerLanguageDriverConfig.TemplateFileConfig.setBaseDir(String)
because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)Set a base directory for reading template resources.- Parameters:
basePackage
- a base directory for reading template resources
-
getTemplateFile
Get a template file configuration.- 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-freemarker.properties that encoded by UTF-8. Also, you can change the properties file that will read using system property (-Dmybatis-freemarker.config.file=... -Dmybatis-freemarker.config.encoding=...).
Supported properties are as follows:Supported properties Property Key Description Default General configuration base-package The base directory for reading template resources None(just under classpath) freemarker-settings.* The settings of freemarker Configurable.setSetting(String, String)
).- - Returns:
- a configuration instance
-
newInstance
Create an instance from specified properties.- Parameters:
customProperties
- custom configuration properties- Returns:
- a configuration instance
- See Also:
-
newInstance
public static FreeMarkerLanguageDriverConfig newInstance(Consumer<FreeMarkerLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.- Parameters:
customizer
- baseline customizer- Returns:
- a configuration instance
- See Also:
-
FreeMarkerLanguageDriverConfig.TemplateFileConfig.getBaseDir()
} because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)