freemarker.ext.beans
Class ListModel

java.lang.Object
  extended by freemarker.ext.beans.ObjectModelBase
      extended by freemarker.ext.beans.ObjectModel
          extended by freemarker.ext.beans.CollectionModel
              extended by freemarker.ext.beans.ListModel
All Implemented Interfaces:
TemplateHashModel, TemplateIndexedModel, TemplateListModel2, TemplateModel, TemplateObjectModel, TemplateScalarModel, java.io.Serializable

Deprecated. this class is deprecated in favour of the classes in the freemarker.ext.beans2 package

public final class ListModel
extends CollectionModel
implements TemplateIndexedModel

A special case of CollectionModel that implements TemplateIndexedModel to allow gets using numbered indexes.

Version:
$Id: ListModel.java 1101 2013-04-01 04:17:32Z run2000 $
Author:
Nicholas Cull
See Also:
Serialized Form

Field Summary
 
Fields inherited from class freemarker.ext.beans.ObjectModelBase
object
 
Constructor Summary
ListModel(java.util.List list)
          Deprecated. Creates a new model that wraps the specified collection object.
 
Method Summary
 TemplateModel getAtIndex(long index)
          Deprecated. Get the object at the specified index.
static CollectionModel getInstance(java.util.List object)
          Deprecated. Returns a model wrapping the specified list object.
 freemarker.ext.beans.ObjectModelBase.ModelType getType()
          Deprecated. Returns the type of this object (which is TYPE_COLLECTION)
 
Methods inherited from class freemarker.ext.beans.CollectionModel
get, getInstance, isEmpty, releaseIterator, templateIterator
 
Methods inherited from class freemarker.ext.beans.ObjectModel
getInstance
 
Methods inherited from class freemarker.ext.beans.ObjectModelBase
getAsObject, getAsString, getInstance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface freemarker.template.TemplateModel
isEmpty
 

Constructor Detail

ListModel

public ListModel(java.util.List list)
Deprecated. 
Creates a new model that wraps the specified collection object.

Parameters:
list - the list object to wrap into a model.
Method Detail

getInstance

public static final CollectionModel getInstance(java.util.List object)
Deprecated. 
Returns a model wrapping the specified list object. If there is already a cached model instance for this list, returns the cached model instance. Models are cached using WeakReference objects. The caching can be turned off by setting the expose.reflection.nocache system property to true. In this case calling this method is equivalent to constructing a new model.

Parameters:
object - the list to wrap into a model.
Returns:
the model for the list

getType

public freemarker.ext.beans.ObjectModelBase.ModelType getType()
Deprecated. 
Returns the type of this object (which is TYPE_COLLECTION)

Overrides:
getType in class CollectionModel

getAtIndex

public TemplateModel getAtIndex(long index)
                         throws TemplateModelException
Deprecated. 
Get the object at the specified index. Returns a suitable TemplateModel for the underlying value.

Specified by:
getAtIndex in interface TemplateIndexedModel
Parameters:
index - the index of object within the list
Returns:
the object at the specified index
Throws:
TemplateModelException - there was a problem with the