freemarker.template
Interface TemplateListModel

All Superinterfaces:
TemplateModel
All Known Implementing Classes:
SimpleList

public interface TemplateListModel
extends TemplateModel

List values in a template data model must implement this interface, which is essentially the Iterator interface plus a rewind() method that allows the list to be read again.

The detail messages of any TemplateModelExceptions thrown will be included as HTML comments in the output.


Method Summary
 TemplateModel get(int i)
           
 boolean hasNext()
           
 boolean isRewound()
           
 TemplateModel next()
           
 void rewind()
          Resets the cursor to the beginning of the list.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

rewind

public void rewind()
            throws TemplateModelException
Resets the cursor to the beginning of the list.

isRewound

public boolean isRewound()
                  throws TemplateModelException
Returns:
true if the cursor is at the beginning of the list.

hasNext

public boolean hasNext()
                throws TemplateModelException
Returns:
true if there is a next element.

next

public TemplateModel next()
                   throws TemplateModelException
Returns:
the next element in the list.

get

public TemplateModel get(int i)
                  throws TemplateModelException
Returns:
the specified index in the list