Class ListDataProvider<T extends java.io.Serializable>
- java.lang.Object
-
- org.apache.wicket.markup.repeater.data.ListDataProvider<T>
-
- Type Parameters:
T-
- All Implemented Interfaces:
java.io.Serializable,IDataProvider<T>,IDetachable,org.apache.wicket.util.io.IClusterable
public class ListDataProvider<T extends java.io.Serializable> extends java.lang.Object implements IDataProvider<T>
Allows the use of lists withDataView. The only requirement is that either list items must be serializable or model(Object) needs to be overridden to provide the proper model implementation.- Author:
- Igor Vaynberg ( ivaynberg )
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ListDataProvider()Constructs an empty provider.ListDataProvider(java.util.List<T> list)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.List<T>getData()Subclass to lazy load the listjava.util.Iterator<T>iterator(long first, long count)Gets an iterator for the subset of total dataIModel<T>model(T object)Callback used by the consumer of this data provider to wrap objects retrieved fromIDataProvider.iterator(long, long)with a model (usually a detachable one).longsize()Gets total number of items in the collection represented by the DataProvider-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.wicket.markup.repeater.data.IDataProvider
detach
-
-
-
-
Method Detail
-
getData
protected java.util.List<T> getData()
Subclass to lazy load the list- Returns:
- The list
-
iterator
public java.util.Iterator<T> iterator(long first, long count)
Description copied from interface:IDataProviderGets an iterator for the subset of total data- Specified by:
iteratorin interfaceIDataProvider<T extends java.io.Serializable>- Parameters:
first- first row of datacount- minimum number of elements to retrieve- Returns:
- iterator capable of iterating over {first, first+count} items
-
size
public long size()
Description copied from interface:IDataProviderGets total number of items in the collection represented by the DataProvider- Specified by:
sizein interfaceIDataProvider<T extends java.io.Serializable>- Returns:
- total item count
-
model
public IModel<T> model(T object)
Description copied from interface:IDataProviderCallback used by the consumer of this data provider to wrap objects retrieved fromIDataProvider.iterator(long, long)with a model (usually a detachable one).- Specified by:
modelin interfaceIDataProvider<T extends java.io.Serializable>- Parameters:
object- the object that needs to be wrapped- Returns:
- the model representation of the object
-
-