Package freemarker.template
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.
"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
-
Method Details
-
exec
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 theTemplateMethodModelEx
instead.- Parameters:
arguments
- aList
ofString
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 implementTemplateModel
, it will be automatically wrapped using theenvironment object wrapper
. - Throws:
TemplateModelException
-
TemplateMethodModelEx
instead. This interface is from the old times when the only kind of value you could pass in was string.