org.apache.wicket.markup.repeater.data
Class EmptyDataProvider<T>

java.lang.Object
  extended by org.apache.wicket.markup.repeater.data.EmptyDataProvider<T>
Type Parameters:
T -
All Implemented Interfaces:
java.io.Serializable, IClusterable, IDataProvider<T>, IDetachable

public class EmptyDataProvider<T>
extends java.lang.Object
implements IDataProvider<T>

A convenience class to represent an empty data provider.

Author:
Phil Kulak
See Also:
Serialized Form

Constructor Summary
EmptyDataProvider()
           
 
Method Summary
 void detach()
          Detaches model after use.
static
<T> EmptyDataProvider<T>
getInstance()
           
 java.util.Iterator<T> iterator(int first, int count)
          Gets an iterator for the subset of total data
 IModel<T> model(java.lang.Object object)
          Callback used by the consumer of this data provider to wrap objects retrieved from IDataProvider.iterator(int, int) with a model (usually a detachable one).
 int size()
          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
 

Constructor Detail

EmptyDataProvider

public EmptyDataProvider()
Method Detail

getInstance

public static <T> EmptyDataProvider<T> getInstance()
Type Parameters:
T -
Returns:
the singleton instance of this class

iterator

public java.util.Iterator<T> iterator(int first,
                                      int count)
Description copied from interface: IDataProvider
Gets an iterator for the subset of total data

Specified by:
iterator in interface IDataProvider<T>
Parameters:
first - first row of data
count - minimum number of elements to retrieve
Returns:
iterator capable of iterating over {first, first+count} items
See Also:
IDataProvider.iterator(int, int)

size

public int size()
Description copied from interface: IDataProvider
Gets total number of items in the collection represented by the DataProvider

Specified by:
size in interface IDataProvider<T>
Returns:
total item count
See Also:
IDataProvider.size()

model

public IModel<T> model(java.lang.Object object)
Description copied from interface: IDataProvider
Callback used by the consumer of this data provider to wrap objects retrieved from IDataProvider.iterator(int, int) with a model (usually a detachable one).

Specified by:
model in interface IDataProvider<T>
Parameters:
object - the object that needs to be wrapped
Returns:
the model representation of the object
See Also:
IDataProvider.model(Object)

detach

public void detach()
Description copied from interface: IDetachable
Detaches model after use. This is generally used to null out transient references that can be re-attached later.

Specified by:
detach in interface IDetachable
See Also:
IDetachable.detach()


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.