freemarker.template
Interface TemplateWriteableIndexedModel
- All Superinterfaces:
- TemplateIndexedModel, TemplateModel
- All Known Implementing Classes:
- ArrayWrapper, FastList, IndexedPropertyWrapper, ListWrapper
public interface TemplateWriteableIndexedModel
- extends TemplateIndexedModel
Writeable values that can be indexed by a numeric value must implement
this interface.
The contract of this interface is general enough that an index need
not start at any particular place, be sequential, or be limited in size,
other than the limits given by TemplateNumberModel
(a 64-bit signed
integer). It also doesn't specify what should happen if the index is outside
the existing range. The list can be extended, or an exception thrown.
- Since:
- 1.9
- Version:
- $Id: TemplateWriteableIndexedModel.java 1067 2011-06-06 10:55:28Z run2000 $
- See Also:
TemplateIndexedModel
putAtIndex
void putAtIndex(long index,
TemplateModel model)
throws TemplateModelException
- Set the value corresponding to the given index. Traditionally this would
correspond to an index into an array, or similar structure, such as a
java.util.Vector
.
- Parameters:
index
- the index of the underlying value we're interested inmodel
- the TemplateModel
to be added to the list
for the given index
- Throws:
TemplateModelException
- the value could not be set, possibly
due to an index out-of-bounds, or some other error