Package org.mybatis.scripting.thymeleaf
Class MyBatisBindingContext
java.lang.Object
org.mybatis.scripting.thymeleaf.MyBatisBindingContext
The context object for integrating with MyBatis and Thymeleaf template engine.
- Version:
- 1.0.0
- Author:
- Kazuki Shimizu
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Return whether contains specified variable into custom bind variables.generateUniqueName
(String objectName, org.thymeleaf.engine.IterationStatusVar status) Generate an unique variable name per iteration object.static MyBatisBindingContext
load
(org.thymeleaf.context.IContext context) Load instance fromIContext
provided by Thymeleaf.void
setCustomBindVariable
(String name, Object value) Set a value into custom bind variable.
-
Method Details
-
load
Load instance fromIContext
provided by Thymeleaf.- Parameters:
context
- a context of thymeleaf template processing- Returns:
- instance of this class
-
setCustomBindVariable
-
containsCustomBindVariable
Return whether contains specified variable into custom bind variables.- Parameters:
name
- variable name- Returns:
- If specified variable exists, return
true
-
generateUniqueName
Generate an unique variable name per iteration object.
Variable name rule is{objectName}_{status list index}_{status.getIndex()}
.- Parameters:
objectName
- base object namestatus
- iteration status object- Returns:
- an unique variable name per iteration object
-