freemarker.ext.beans2
Class EnumerationWrapper<T extends java.util.Enumeration>

java.lang.Object
  extended by freemarker.ext.beans2.BeanWrapper<T>
      extended by freemarker.ext.beans2.EnumerationWrapper<T>
All Implemented Interfaces:
ObjectWrapper, TemplateHashModel, TemplateIteratorModel, TemplateModel, TemplateObjectModel, TemplateScalarModel, TemplateWriteableHashModel, java.io.Serializable, java.lang.Cloneable

public class EnumerationWrapper<T extends java.util.Enumeration>
extends BeanWrapper<T>
implements TemplateIteratorModel, java.io.Serializable

Since:
1.9
Version:
$Id: EnumerationWrapper.java 1164 2005-10-09 11:57:04Z run2000 $
Author:
Nicholas Cull
See Also:
Serialized Form

Field Summary
 
Fields inherited from class freemarker.ext.beans2.BeanWrapper
emptyParams, object
 
Constructor Summary
EnumerationWrapper()
           
EnumerationWrapper(T enumeration)
           
 
Method Summary
 boolean hasNext()
          Do we have another item in the list?
 boolean isEmpty()
          Is the object empty?
 TemplateModel next()
          Retrieve the next item in the list.
 
Methods inherited from class freemarker.ext.beans2.BeanWrapper
clone, get, getAsObject, getAsString, put, setObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumerationWrapper

public EnumerationWrapper()

EnumerationWrapper

public EnumerationWrapper(T enumeration)
Method Detail

isEmpty

public boolean isEmpty()
                throws TemplateModelException
Is the object empty?

Specified by:
isEmpty in interface TemplateModel
Overrides:
isEmpty in class BeanWrapper<T extends java.util.Enumeration>
Returns:
true if this object is empty, otherwise false
Throws:
TemplateModelException

hasNext

public boolean hasNext()
                throws TemplateModelException
Do we have another item in the list?

Specified by:
hasNext in interface TemplateIteratorModel
Returns:
true if there are more items to be iterated over, otherwise false
Throws:
TemplateModelException - there was a problem determining the next item in the list

next

public TemplateModel next()
                   throws TemplateModelException
Retrieve the next item in the list. The item will be a TemplateModel containing the underlying value.

Specified by:
next in interface TemplateIteratorModel
Returns:
the next item in the list
Throws:
TemplateModelException - the next item couldn't be retrieved, or we're at the end of the list