Package com.vaadin.flow.data.provider
Interface DataGenerator<T>
-
- Type Parameters:
T
- the data type
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractComponentDataGenerator
,AbstractGridMultiSelectionModel
,AbstractGridSingleSelectionModel
,BeanDataGenerator
,ComponentDataGenerator
,CompositeDataGenerator
,EditorImpl
,EditorRenderer
,Grid.AbstractGridExtension
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface DataGenerator<T> extends Serializable
A data generator forDataCommunicator
. Used to inject custom data to data items sent to the client for extension purposes.- Since:
- 1.0.
- Author:
- Vaadin Ltd
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
destroyAllData()
Informs theDataGenerator
that all data has been dropped.default void
destroyData(T item)
Informs theDataGenerator
that the given data item has been dropped and is no longer needed.void
generateData(T item, elemental.json.JsonObject jsonObject)
Adds custom data for the given item to its serializedJsonObject
representation.default void
refreshData(T item)
Informs theDataGenerator
that a data object has been updated.
-
-
-
Method Detail
-
generateData
void generateData(T item, elemental.json.JsonObject jsonObject)
Adds custom data for the given item to its serializedJsonObject
representation. This JSON object will be sent to client-side DataProvider.- Parameters:
item
- the data item being serializedjsonObject
- the JSON object being sent to the client
-
destroyData
default void destroyData(T item)
Informs theDataGenerator
that the given data item has been dropped and is no longer needed. This method should clean up any unneeded information stored for this item.- Parameters:
item
- the dropped data item
-
destroyAllData
default void destroyAllData()
Informs theDataGenerator
that all data has been dropped. This method should clean up any unneeded information stored for items.
-
refreshData
default void refreshData(T item)
Informs theDataGenerator
that a data object has been updated. This method should update any unneeded information stored for given item.- Parameters:
item
- the updated item
-
-