| java.lang.Object freemarker.ext.beans.BeanModel freemarker.ext.beans.EnumerationModel
EnumerationModel | public class EnumerationModel extends BeanModel implements TemplateModelIterator,TemplateCollectionModel(Code) | | A class that adds
TemplateModelIterator functionality to the
Enumeration interface implementers.
Using the model as a collection model is NOT thread-safe, as
enumerations are inherently not thread-safe.
Further, you can iterate over it only once. Attempts to call the
EnumerationModel.iterator() method after it was already driven to the end once will
throw an exception.
author: Attila Szegedi version: $Id: EnumerationModel.java,v 1.24 2003/06/03 13:21:32 szegedia Exp $ |
Constructor Summary | |
public | EnumerationModel(Enumeration enumeration, BeansWrapper wrapper) Creates a new model that wraps the specified enumeration object.
Parameters: enumeration - the enumeration object to wrap into a model. Parameters: wrapper - the BeansWrapper associated with this model.Every model has to have an associated BeansWrapper instance. |
EnumerationModel | public EnumerationModel(Enumeration enumeration, BeansWrapper wrapper)(Code) | | Creates a new model that wraps the specified enumeration object.
Parameters: enumeration - the enumeration object to wrap into a model. Parameters: wrapper - the BeansWrapper associated with this model.Every model has to have an associated BeansWrapper instance. Themodel gains many attributes from its wrapper, including the caching behavior, method exposure level, method-over-item shadowing policy etc. |
getAsBoolean | public boolean getAsBoolean()(Code) | | Returns
Enumeration.hasMoreElements . Therefore, an
enumeration that has no more element evaluates to false, and an
enumeration that has further elements evaluates to true.
|
|
|