Package org.mybatis.scripting.velocity
Class VelocityLanguageDriverConfig
java.lang.Object
org.mybatis.scripting.velocity.VelocityLanguageDriverConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGenerate a custom directives string.Get additional context attributes.String[]
Deprecated.Recommend to use the 'velocity-settings.runtime.custom_directives' or 'runtime.custom_directives' because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)Get Velocity settings.static VelocityLanguageDriverConfig
Create an instance from default properties file.static VelocityLanguageDriverConfig
newInstance
(Consumer<VelocityLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.static VelocityLanguageDriverConfig
newInstance
(Properties customProperties) Create an instance from specified properties.void
setUserdirective
(String... userDirectives) Deprecated.Recommend to use the 'velocity-settings.runtime.custom_directives' or 'runtime.custom_directives' because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)
-
Constructor Details
-
VelocityLanguageDriverConfig
public VelocityLanguageDriverConfig()
-
-
Method Details
-
getVelocitySettings
-
getUserdirective
Deprecated.Recommend to use the 'velocity-settings.runtime.custom_directives' or 'runtime.custom_directives' because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)Get user define directives.- Returns:
- user define directives.
-
setUserdirective
Deprecated.Recommend to use the 'velocity-settings.runtime.custom_directives' or 'runtime.custom_directives' because this method defined for keeping backward compatibility (There is possibility that this method removed at a future version)Set user define directives.- Parameters:
userDirectives
- user define directives
-
getAdditionalContextAttributes
-
generateCustomDirectivesString
Generate a custom directives string.- Returns:
- a custom directives string
-
newInstance
Create an instance from default properties file.
If you want to customize a defaultRuntimeInstance
, you can configure some property using mybatis-velocity.properties that encoded by UTF-8. Also, you can change the properties file that will read using system property (-Dmybatis-velocity.config.file=... -Dmybatis-velocity.config.encoding=...).
Supported properties are as follows:Supported properties Property Key Description Default Directive configuration userdirective The user defined directives (Recommend to use the 'velocity-settings.runtime.custom_directives' property because this property defined for keeping backward compatibility) None(empty) Additional context attribute configuration additional.context.attributes The user defined additional context attribute values(Recommend to use the 'additional-context-attributes.{name}' because this property defined for keeping backward compatibility) None(empty) additional-context-attributes.{name} The user defined additional context attributes value(FQCN) - Velocity settings configuration velocity-settings.{name} The settings of Velocity's RuntimeInstance.setProperty(String, Object)
- {name} The settings of Velocity's RuntimeInstance.setProperty(String, Object)
(Recommend to use the 'velocity-settings.{name}' because this property defined for keeping backward compatibility)- - 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 VelocityLanguageDriverConfig newInstance(Consumer<VelocityLanguageDriverConfig> customizer) Create an instance using specified customizer and override using a default properties file.- Parameters:
customizer
- baseline customizer- Returns:
- a configuration instance
- See Also:
-