T - the data type of the underlying DataGeneratorspublic class CompositeDataGenerator<T> extends Object implements DataGenerator<T>, HasDataGenerators<T>
DataGenerator that aggregates multiple DataGenerators and delegates
the data generation to them. It doesn't generate or destroy any data by its
own.
It is used by components that need to add and remove DataGenerators dynamically, or that support multiple layers of data generation.
| Constructor and Description |
|---|
CompositeDataGenerator() |
| Modifier and Type | Method and Description |
|---|---|
Registration |
addDataGenerator(DataGenerator<T> generator)
Adds the given data generator.
|
void |
destroyAllData()
Informs the
DataGenerator that all data has been dropped. |
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. |
void |
refreshData(T item)
Informs the
DataGenerator that a data object has been updated. |
void |
removeDataGenerator(DataGenerator<T> generator)
Removes the DataGenerator from the list, destroying its data.
|
public void generateData(T item, elemental.json.JsonObject jsonObject)
DataGeneratorJsonObject
representation. This JSON object will be sent to client-side
DataProvider.generateData in interface DataGenerator<T>item - the data item being serializedjsonObject - the JSON object being sent to the clientpublic void destroyData(T item)
DataGeneratorDataGenerator 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.destroyData in interface DataGenerator<T>item - the dropped data itempublic void destroyAllData()
DataGeneratorDataGenerator that all data has been dropped. This
method should clean up any unneeded information stored for items.destroyAllData in interface DataGenerator<T>public void refreshData(T item)
DataGeneratorDataGenerator that a data object has been updated.
This method should update any unneeded information stored for given item.refreshData in interface DataGenerator<T>item - the updated itempublic Registration addDataGenerator(DataGenerator<T> generator)
HasDataGeneratorsaddDataGenerator in interface HasDataGenerators<T>generator - the data generator to addpublic void removeDataGenerator(DataGenerator<T> generator)
removeDataGenerator in interface HasDataGenerators<T>generator - the data generator to removeCopyright © 2025. All rights reserved.