TemplateModelIterator (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, interface: TemplateModelIterator

Package freemarker.template

# Interface TemplateModelIterator

All Known Implementing Classes:
  `EnumerationModel`, `IteratorModel`

public interface TemplateModelIterator
Used to iterate over a set of template models once; usually returned from `TemplateCollectionModel.iterator()`. Note that it's not a `TemplateModel`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasNext()`
  `TemplateModel`
  `next()`
  Returns the next model.

- ## Method Details

  - ### next

    TemplateModel next() throws TemplateModelException
    Returns the next model.
    Throws:
      `TemplateModelException` - if the next model can not be retrieved (i.e. because the iterator is exhausted).

  - ### hasNext

    boolean hasNext() throws TemplateModelException
    Returns:
      whether there are any more items to iterate over.
    Throws:
      `TemplateModelException`