|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object freemarker.ext.beans2.BeanWrapper<T> freemarker.ext.beans2.IterableWrapper<T> freemarker.ext.beans2.CollectionWrapper<T>
public class CollectionWrapper<T extends java.util.Collection>
Wraps Collection objects by providing additional methods to support list models and method support for getting and setting values. Also a base class for ListWrapper.
Field Summary |
---|
Fields inherited from class freemarker.ext.beans2.BeanWrapper |
---|
emptyParams, object |
Constructor Summary | |
---|---|
CollectionWrapper()
Default constructor where an object is not provided initially. |
|
CollectionWrapper(T object)
Constructor that takes a Collection object to be wrapped. |
Method Summary | |
---|---|
TemplateModel |
exec(java.util.List<TemplateModel> arguments)
Tests or sets an object in a Collection. |
Methods inherited from class freemarker.ext.beans2.IterableWrapper |
---|
releaseIterator, templateIterator |
Methods inherited from class freemarker.ext.beans2.BeanWrapper |
---|
clone, get, getAsObject, getAsString, isEmpty, put, setObject |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface freemarker.template.TemplateListModel2 |
---|
releaseIterator, templateIterator |
Methods inherited from interface freemarker.template.TemplateModel |
---|
isEmpty |
Constructor Detail |
---|
public CollectionWrapper()
public CollectionWrapper(T object)
object
- the collection object to be wrappedMethod Detail |
---|
public TemplateModel exec(java.util.List<TemplateModel> arguments) throws TemplateModelException
Otherwise, if the second argument is either empty or the boolean value "false", then the object is removed from the collection.
Finally, if the second argument is any other value, then add the object to the collection.
exec
in interface TemplateMethodModel2
arguments
- a List
of TemplateModel
objects
containing the values of the arguments passed to the method.
TemplateModel
produced by the method, or null
.
TemplateModelException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |