wicket.extensions.markup.html.repeater.data
Class EmptyDataProvider

java.lang.Object
  extended bywicket.extensions.markup.html.repeater.data.EmptyDataProvider
All Implemented Interfaces:
IDataProvider, ISortableDataProvider, java.io.Serializable

public class EmptyDataProvider
extends java.lang.Object
implements ISortableDataProvider

A convienience class to represent an empty data provider.

Author:
philk
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class wicket.extensions.markup.html.repeater.data.sort.ISortableDataProvider
ISortableDataProvider.SortState
 
Constructor Summary
EmptyDataProvider()
           
 
Method Summary
 void addSort(java.lang.String property)
          Adds the field to the end of the sort list.
static EmptyDataProvider getInstance()
           
 java.util.List getSortList()
           
 ISortableDataProvider.SortState getSortState(java.lang.String property)
          Gets the sort state of a property
 java.util.Iterator iterator(int first, int count)
          Gets an iterator for the subset of total data
 wicket.model.IModel model(java.lang.Object object)
          Converts the object in the collection to its model representation.
 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 EmptyDataProvider getInstance()
Returns:
the singleton instance of this class

addSort

public void addSort(java.lang.String property)
Description copied from interface: ISortableDataProvider
Adds the field to the end of the sort list. If it already exists, it's first removed, then the ordering is flipped.

Specified by:
addSort in interface ISortableDataProvider
Parameters:
property - the name of the property to sort on
See Also:
ISortableDataProvider.addSort(java.lang.String)

getSortList

public java.util.List getSortList()
Specified by:
getSortList in interface ISortableDataProvider
Returns:
list of sort params (most recent first)
See Also:
ISortableDataProvider.getSortList()

getSortState

public ISortableDataProvider.SortState getSortState(java.lang.String property)
Description copied from interface: ISortableDataProvider
Gets the sort state of a property

Specified by:
getSortState in interface ISortableDataProvider
Parameters:
property - sort property to be checked
Returns:
1 if ascending, -1 if descending, 0 if none
See Also:
ISortableDataProvider.getSortState(java.lang.String)

iterator

public java.util.Iterator 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
Parameters:
first - first row of data
count - minumum 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
Returns:
total item count
See Also:
IDataProvider.size()

model

public wicket.model.IModel model(java.lang.Object object)
Description copied from interface: IDataProvider
Converts the object in the collection to its model representation. This is a good place to wrap your objects in a detachable model.

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


Copyright © 2004-2006 . All Rights Reserved.