freemarker.ext.beans2
Class StaticMethodWrapper

java.lang.Object
  extended by freemarker.ext.beans2.StaticMethodWrapper
All Implemented Interfaces:
TemplateMethodModel2, TemplateModel

public class StaticMethodWrapper
extends java.lang.Object
implements TemplateMethodModel2

Since:
1.9
Version:
$Id: StaticMethodWrapper.java 1154 2005-10-09 09:22:01Z run2000 $
Author:
Nicholas Cull

Field Summary
protected  java.lang.Class clazz
           
protected static Converter[] emptyConverters
           
protected static TemplateModel[] emptyModelArguments
           
protected static java.lang.Object[] emptyParamValues
           
protected  java.lang.String identifier
           
 
Constructor Summary
StaticMethodWrapper()
           
StaticMethodWrapper(java.lang.Class clazz, java.lang.String identifier)
           
 
Method Summary
 TemplateModel exec(java.util.List<TemplateModel> arguments)
          Executes a method call.
 java.lang.Class getClazz()
           
 java.lang.String getIdentifier()
           
 boolean isEmpty()
          Is the object empty?
 void setClazz(java.lang.Class clazz)
           
 void setIdentifier(java.lang.String identifier)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

emptyParamValues

protected static final java.lang.Object[] emptyParamValues

emptyConverters

protected static final Converter[] emptyConverters

emptyModelArguments

protected static final TemplateModel[] emptyModelArguments

clazz

protected java.lang.Class clazz

identifier

protected java.lang.String identifier
Constructor Detail

StaticMethodWrapper

public StaticMethodWrapper()

StaticMethodWrapper

public StaticMethodWrapper(java.lang.Class clazz,
                           java.lang.String identifier)
Method Detail

setClazz

public void setClazz(java.lang.Class clazz)

getClazz

public java.lang.Class getClazz()

setIdentifier

public void setIdentifier(java.lang.String identifier)

getIdentifier

public java.lang.String getIdentifier()

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Description copied from interface: TemplateModel
Is the object empty?

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

exec

public TemplateModel exec(java.util.List<TemplateModel> arguments)
                   throws TemplateModelException
Description copied from interface: TemplateMethodModel2
Executes a method call. Arguments are passed as a List of TemplateModel objects.

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