freemarker.template
Interface TemplateIteratorModel

All Superinterfaces:
TemplateModel
All Known Subinterfaces:
TemplateWriteableIteratorModel
All Known Implementing Classes:
EnumerationWrapper, ExtendedIterator, FastIndexedIterator, FastIndexedWriteableIterator, FastIterator, FastListIterator, IteratorWrapper, ListIteratorWrapper, NodeListIterator

public interface TemplateIteratorModel
extends TemplateModel

Iterators that iterate over a TemplateListModel2 must implement this interface. The interface is almost identical to the java.util.Iterator interface, so that such iterators can be transparently wrapped in a TemplateIteratorModel implementation.

Since:
1.8
Version:
$Id: TemplateIteratorModel.java 1101 2013-04-01 04:17:32Z run2000 $
See Also:
TemplateListModel2, TemplateWriteableIteratorModel

Method Summary
 boolean hasNext()
          Do we have another item in the list?
 TemplateModel next()
          Retrieve the next item in the list.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

hasNext

boolean hasNext()
                throws TemplateModelException
Do we have another item in the list?

Returns:
true if there are more items to be iterated over, otherwise false
Throws:
TemplateModelException - there was a problem determining the next item in the list

next

TemplateModel next()
                   throws TemplateModelException
Retrieve the next item in the list. The item will be a TemplateModel containing the underlying value.

Returns:
the next item in the list
Throws:
TemplateModelException - the next item couldn't be retrieved, or we're at the end of the list