freemarker.ext.beans
Class MethodModel

java.lang.Object
  extended by freemarker.ext.beans.MethodModel
All Implemented Interfaces:
TemplateMethodModel2, TemplateModel

Deprecated. this class is deprecated in favour of the classes in the freemarker.ext.beans2 package

public final class MethodModel
extends java.lang.Object
implements TemplateMethodModel2

A class that will wrap a reflected method call into a TemplateMethodModel2 interface. It can be used directly, and is heavily used by ObjectModel to wrap reflected method calls.

Version:
$Id: MethodModel.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Attila Szegedi, attila@szegedi.org

Constructor Summary
MethodModel(java.lang.Object object, java.lang.reflect.Method method)
          Deprecated. Creates a model for a specific method on a specific object.
 
Method Summary
 TemplateModel exec(java.util.List<TemplateModel> arguments)
          Deprecated. Invokes the method, passing it the arguments from the list.
 boolean isEmpty()
          Deprecated. Returns true if the wrapped method's return type is void.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodModel

public MethodModel(java.lang.Object object,
                   java.lang.reflect.Method method)
Deprecated. 
Creates a model for a specific method on a specific object.

Parameters:
object - the object to call the method on. Can be null for static methods.
method - the method that will be invoked.
Method Detail

exec

public TemplateModel exec(java.util.List<TemplateModel> arguments)
                   throws TemplateModelException
Deprecated. 
Invokes the method, passing it the arguments from the list. Since in the current release of FM-Classic (1.8), all elements of the argument list can now be of any type, including possibly wrapped objects, go through the unwrap process before calling the method.

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

isEmpty

public boolean isEmpty()
Deprecated. 
Returns true if the wrapped method's return type is void.

Specified by:
isEmpty in interface TemplateModel
Returns:
true if this object is empty, otherwise false