freemarker.template
Interface TemplateMethodModel

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

public interface TemplateMethodModel
extends TemplateModel

Objects that act as methods in a template data model must implement this interface.

Version:
$Id: TemplateMethodModel.java,v 1.11 2003/09/22 23:56:54 revusky Exp $

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Method Summary
 java.lang.Object exec(java.util.List arguments)
          Executes a method call.
 

Method Detail

exec

java.lang.Object exec(java.util.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 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