freemarker.template
Interface TemplateListModel

All Superinterfaces:
TemplateModel

Deprecated. This interface is not multi-thread safe, and also, in some cases, not single-thread safe either. Use the TemplateListModel2 interface instead.

@Deprecated
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. As of 1.5.3, there is also a get(int) method that allows the list to be accessed in a random-access fashion.

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

Version:
$Id: TemplateListModel.java 1101 2013-04-01 04:17:32Z run2000 $
See Also:
TemplateListModel2, TemplateIndexedModel

Method Summary
 TemplateModel get(int index)
          Deprecated. Retrieves the specified item from the list.
 boolean hasNext()
          Deprecated. Is there a next item in the list?
 boolean isRewound()
          Deprecated. Is the cursor at the beginning of the list?
 TemplateModel next()
          Deprecated. Retrieves the next item in the list.
 void rewind()
          Deprecated. Resets the cursor to the beginning of the list.
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Method Detail

rewind

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

Throws:
TemplateModelException

isRewound

boolean isRewound()
                  throws TemplateModelException
Deprecated. 
Is the cursor at the beginning of the list?

Returns:
true if the cursor is at the beginning of the list, otherwise false.
Throws:
TemplateModelException

hasNext

boolean hasNext()
                throws TemplateModelException
Deprecated. 
Is there a next item in the list?

Returns:
true if there is a next element, otherwise false.
Throws:
TemplateModelException

next

TemplateModel next()
                   throws TemplateModelException
Deprecated. 
Retrieves the next item in the list.

Returns:
the next element in the list.
Throws:
TemplateModelException - the next item in the list can't be retrieved, or no next item exists.

get

TemplateModel get(int index)
                  throws TemplateModelException
Deprecated. 
Retrieves the specified item from the list.

Parameters:
index - the index of the item to be retrieved.
Returns:
the specified index in the list.
Throws:
TemplateModelException - the specified item in the list can't be retrieved, or the index is out of bounds.
Since:
1.5.3