Package freemarker.template
Interface TemplateMethodModel
-
- All Superinterfaces:
TemplateModel
- All Known Subinterfaces:
LazilyEvaluatableArguments,TemplateMethodModelEx
public interface TemplateMethodModel extends TemplateModel
Objects that act as methods in a template data model must implement this interface.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface freemarker.template.TemplateModel
TemplateModel.InvalidExpressionModel, TemplateModel.JavaNull
-
-
Field Summary
-
Fields inherited from interface freemarker.template.TemplateModel
INVALID_EXPRESSION, JAVA_NULL, NOTHING
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Objectexec(List arguments)Executes a method call.
-
-
-
Method Detail
-
exec
Object exec(List arguments) throws TemplateModelException
Executes a 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 theTemplateMethodModelExinstead.- 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 theenvironment object wrapper. - Throws:
TemplateModelException
-
-