freemarker.ext.misc
Class Increment

java.lang.Object
  |
  +--freemarker.ext.misc.Increment
All Implemented Interfaces:
TemplateMethodModel, TemplateModel

Deprecated. With the introduction of native numbers and numeric operators in 1.8, this implementation is now deprecated

public class Increment
extends java.lang.Object
implements TemplateMethodModel

Allows numeric values in a data model to be incremented. The return value is always an integer value.

Usage:
From java:

 TemplateModelRoot root = new SimpleHash();

 root.put( "increment", new freemarker.ext.misc.Increment() );

 ...
 

From your FM-Classic template:

 <assign var1 = 2>
 <assign var1 = increment( var1 )>
 <p>The incremented value of var1 is: ${var1}</p>

 ...
 

Since:
1.7
Version:
$Id: Increment.java,v 1.8 2003/11/17 13:06:24 run2000 Exp $

Constructor Summary
Increment()
          Deprecated. Creates new Increment
 
Method Summary
 TemplateModel exec(java.util.List arguments)
          Deprecated. Executes a method call.
 boolean isEmpty()
          Deprecated. Is the object empty?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Increment

public Increment()
Deprecated. 
Creates new Increment
Method Detail

exec

public TemplateModel exec(java.util.List arguments)
                   throws TemplateModelException
Deprecated. 
Executes a method call.
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.

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Deprecated. 
Is the object empty?
Specified by:
isEmpty in interface TemplateModel
Returns:
false, to indicate this object is not empty