Package freemarker.ext.rhino
Class RhinoFunctionModel
java.lang.Object
freemarker.ext.rhino.RhinoScriptableModel
freemarker.ext.rhino.RhinoFunctionModel
- All Implemented Interfaces:
AdapterTemplateModel
,TemplateBooleanModel
,TemplateHashModel
,TemplateHashModelEx
,TemplateMethodModel
,TemplateMethodModelEx
,TemplateModel
,TemplateNumberModel
,TemplateScalarModel
,TemplateSequenceModel
-
Field Summary
Fields inherited from interface freemarker.template.TemplateBooleanModel
FALSE, TRUE
Fields inherited from interface freemarker.template.TemplateModel
NOTHING
Fields inherited from interface freemarker.template.TemplateScalarModel
EMPTY_STRING
-
Constructor Summary
ConstructorDescriptionRhinoFunctionModel(org.mozilla.javascript.Function function, org.mozilla.javascript.Scriptable fnThis, BeansWrapper wrapper)
-
Method Summary
Methods inherited from class freemarker.ext.rhino.RhinoScriptableModel
get, get, getAdaptedObject, getAsBoolean, getAsNumber, getAsString, isEmpty, keys, size, values
-
Constructor Details
-
RhinoFunctionModel
public RhinoFunctionModel(org.mozilla.javascript.Function function, org.mozilla.javascript.Scriptable fnThis, BeansWrapper wrapper)
-
-
Method Details
-
exec
Description copied from interface:TemplateMethodModelEx
Executes the method call.- Specified by:
exec
in interfaceTemplateMethodModel
- Specified by:
exec
in interfaceTemplateMethodModelEx
- Parameters:
arguments
- aList
ofTemplateModel
-s, containing the arguments passed to the method. If the implementation absolutely wants to operate on POJOs, it can use the static utility methods in theDeepUnwrap
class to easily obtain them. However, unwrapping is not always possible (or not perfectly), and isn't always efficient, so it's recommended to use the originalTemplateModel
value as much as possible.- Returns:
- the return value of the method, or
null
. If the returned value does not implementTemplateModel
, it will be automatically wrapped using theenvironment's object wrapper
. - Throws:
TemplateModelException
-