Interface used to provide data to data views.
Note that if the IDataProvider implementation implements
IDetachable interface, the
IDetachable.detach method will be called at the end
of request.
Example:
class UsersProvider implements IDataProvider() {
Iterator iterator(int first, int count) {
((MyApplication)Application.get()).getUserDao().iterator(first, count);
}
int size() {
((MyApplication)Application.get()).getUserDao().getCount();
}
IModel model(Object object) {
return new DetachableUserModel((User)object);
}
}
See Also: DataViewBase See Also: DataView See Also: GridView author: Igor Vaynberg (ivaynberg) author: TODO 2.0: directly extend IDetachable |