Class ParamObjectAdapter

java.lang.Object
org.mybatis.scripting.freemarker.ParamObjectAdapter
All Implemented Interfaces:
freemarker.template.TemplateHashModel, freemarker.template.TemplateModel

public class ParamObjectAdapter extends Object implements freemarker.template.TemplateHashModel
Important: if you are using some object that already has property "p", then MyBatisParamDirective will be unavailable from script.
Author:
elwood
  • Constructor Details

    • ParamObjectAdapter

      public ParamObjectAdapter(Object paramObject, ArrayList generatedParams, freemarker.template.Version incompatibleImprovementsVersion)
  • Method Details

    • putAdditionalParam

      public void putAdditionalParam(String key, freemarker.template.TemplateModel value)
      Puts the additional parameter into adapter, it will be available if no existing property with same key exists. For example, it is suitable to add custom objects and directives into dataContext.
    • getGeneratedParams

      public ArrayList getGeneratedParams()
    • get

      public freemarker.template.TemplateModel get(String key) throws freemarker.template.TemplateModelException
      Specified by:
      get in interface freemarker.template.TemplateHashModel
      Throws:
      freemarker.template.TemplateModelException
    • isEmpty

      public boolean isEmpty() throws freemarker.template.TemplateModelException
      Specified by:
      isEmpty in interface freemarker.template.TemplateHashModel
      Throws:
      freemarker.template.TemplateModelException