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 for DataCommunicator. Used to inject custom data to data items sent to the client for extension purposes.
Since:
1.0.
Author:
Vaadin Ltd
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Informs the DataGenerator that all data has been dropped.
    default void
    destroyData(T item)
    Informs the DataGenerator 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 serialized JsonObject representation.
    default void
    refreshData(T item)
    Informs the DataGenerator that a data object has been updated.
  • Method Details

    • generateData

      void generateData(T item, elemental.json.JsonObject jsonObject)
      Adds custom data for the given item to its serialized JsonObject representation. This JSON object will be sent to client-side DataProvider.
      Parameters:
      item - the data item being serialized
      jsonObject - the JSON object being sent to the client
    • destroyData

      default void destroyData(T item)
      Informs the DataGenerator 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 the DataGenerator that all data has been dropped. This method should clean up any unneeded information stored for items.
    • refreshData

      default void refreshData(T item)
      Informs the DataGenerator that a data object has been updated. This method should update any unneeded information stored for given item.
      Parameters:
      item - the updated item