Package com.vaadin.flow.data.provider
Class BeanDataGenerator<T>
java.lang.Object
com.vaadin.flow.data.provider.BeanDataGenerator<T>
- Type Parameters:
T- the type of the bean to be serialized to the client
- All Implemented Interfaces:
DataGenerator<T>,Serializable
A
DataGenerator that sends all the fields of the objects in the model
to the client, using the field names as property names.
This class is useful for the cases when the properties in the template of the columns have the same name as the fields of the model object in the server side.
Note: this generator sends the entire bean to the client, even if the template in the client doesn't use all the properties.
For objects without inner properties, like Strings, a property called
value is created in the model, so it can be accessed via
[[item.value]] in the template.
- Since:
- 1.2
- Author:
- Vaadin Ltd.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerateData(T item, elemental.json.JsonObject data) Adds custom data for the given item to its serializedJsonObjectrepresentation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.data.provider.DataGenerator
destroyAllData, destroyData, refreshData
-
Constructor Details
-
BeanDataGenerator
public BeanDataGenerator()
-
-
Method Details
-
generateData
Description copied from interface:DataGeneratorAdds custom data for the given item to its serializedJsonObjectrepresentation. This JSON object will be sent to client-side DataProvider.- Specified by:
generateDatain interfaceDataGenerator<T>- Parameters:
item- the data item being serializeddata- the JSON object being sent to the client
-