Interface TemplateMethodModel

All Superinterfaces:
TemplateModel
All Known Subinterfaces:
TemplateMethodModelEx
All Known Implementing Classes:
Execute, JythonHashModel, JythonModel, JythonNumberModel, JythonSequenceModel, MapModel, NodeListModel, NodeListModel, ObjectConstructor, OverloadedMethodsModel, ResourceBundleModel, RhinoFunctionModel, SimpleMapModel, SimpleMethodModel

@Deprecated public interface TemplateMethodModel extends TemplateModel
Deprecated.
Use TemplateMethodModelEx instead. This interface is from the old times when the only kind of value you could pass in was string.
"method" template language data type: Objects that act like functions. The name comes from that their original application was calling Java methods via BeansWrapper.

In templates they are used like myMethod("foo", "bar") or myJavaObject.myJavaMethod("foo", "bar").

  • Field Summary

    Fields inherited from interface freemarker.template.TemplateModel

    NOTHING
  • Method Summary

    Modifier and Type
    Method
    Description
    exec​(List arguments)
    Deprecated.
    Executes the method call.
  • Method Details

    • exec

      Object exec(List arguments) throws TemplateModelException
      Deprecated.
      Executes the method call. All arguments passed to the method call are coerced to strings before being passed, if the FreeMarker rules allow the coercion. If some of the passed arguments can not be coerced to a string, an exception will be raised in the engine and the method will not be called. If your method would like to act on actual data model objects instead of on their string representations, implement the TemplateMethodModelEx instead.
      Parameters:
      arguments - a List of String objects containing the values of the arguments passed to the method.
      Returns:
      the return value of the method, or null. If the returned value does not implement TemplateModel, it will be automatically wrapped using the environment object wrapper.
      Throws:
      TemplateModelException