freemarker.template.expression
Class LambdaMethod

java.lang.Object
  extended by freemarker.template.expression.LambdaMethod
All Implemented Interfaces:
TemplateMethodModel2, TemplateModel, java.io.Serializable

public final class LambdaMethod
extends java.lang.Object
implements TemplateMethodModel2, java.io.Serializable

Implements an instance of a lambda expression.

Since:
1.9
Version:
$Id: LambdaMethod.java 1162 2013-04-20 12:04:32Z run2000 $
Author:
Nicholas Cull
See Also:
Serialized Form

Constructor Summary
LambdaMethod(Expression expression, TemplateWriteableHashModel model, java.util.List<Identifier> paramNames)
          Construct a new Lambda method given an expression to evaluate, a template model for context evaluation, and a list of parameters to be resolved when this method is called.
 
Method Summary
 TemplateModel exec(java.util.List<TemplateModel> arguments)
          Executes a lambda method call.
 boolean isEmpty()
          Is the object empty?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LambdaMethod

public LambdaMethod(Expression expression,
                    TemplateWriteableHashModel model,
                    java.util.List<Identifier> paramNames)
Construct a new Lambda method given an expression to evaluate, a template model for context evaluation, and a list of parameters to be resolved when this method is called.

Parameters:
expression - the expression to be evaluated
model - the template model to be used as context for free variables
paramNames - names of parameters to be passed into the method
Method Detail

isEmpty

public boolean isEmpty()
                throws TemplateModelException
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
Executes a lambda 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