freemarker.ext.rhino
Class RhinoFunctionModel

java.lang.Object
  extended by freemarker.ext.rhino.RhinoScriptableModel
      extended by freemarker.ext.rhino.RhinoFunctionModel
All Implemented Interfaces:
AdapterTemplateModel, TemplateBooleanModel, TemplateHashModel, TemplateHashModelEx, TemplateMethodModel, TemplateMethodModelEx, TemplateModel, TemplateNumberModel, TemplateScalarModel, TemplateSequenceModel

public class RhinoFunctionModel
extends RhinoScriptableModel
implements TemplateMethodModelEx

Version:
$Id: RhinoFunctionModel.java,v 1.2.2.1 2006/12/27 16:10:48 szegedia Exp $
Author:
Attila Szegedi

Field Summary
 
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
 
Fields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING
 
Fields inherited from interface freemarker.template.TemplateBooleanModel
FALSE, TRUE
 
Constructor Summary
RhinoFunctionModel(org.mozilla.javascript.Function function, org.mozilla.javascript.Scriptable fnThis, BeansWrapper wrapper)
           
 
Method Summary
 java.lang.Object exec(java.util.List arguments)
          Executes a method call.
 
Methods inherited from class freemarker.ext.rhino.RhinoScriptableModel
get, get, getAdaptedObject, getAsBoolean, getAsNumber, getAsString, isEmpty, keys, size, values
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RhinoFunctionModel

public RhinoFunctionModel(org.mozilla.javascript.Function function,
                          org.mozilla.javascript.Scriptable fnThis,
                          BeansWrapper wrapper)
Method Detail

exec

public java.lang.Object exec(java.util.List arguments)
                      throws TemplateModelException
Description copied from interface: TemplateMethodModel
Executes a method call. All arguments passed to the method call are treated as TemplateScalarModels, and evaluated to Strings before being passed. If some of the passed arguments is not a scalar, an exception will occur 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.

Specified by:
exec in interface TemplateMethodModel
Parameters:
arguments - a List of String objects containing the values of the arguments passed to the method.
Returns:
the TemplateModel produced by the method, or null.
Throws:
TemplateModelException