public interface JSONSerializer<T>
The serialize(Object, ApplicationConnection) and
deserialize(Type, JsonValue, ApplicationConnection) methods must be
symmetric so they can be chained and produce the original result (or an equal
result).
Each JSONSerializer implementation can handle an object of a single
type - see Type.findSerializer().
This is the client side interface, see com.vaadin.server.communication.JSONSerializer for the server side interface.
| Modifier and Type | Method and Description |
|---|---|
T |
deserialize(Type type,
JsonValue jsonValue,
ApplicationConnection connection)
Creates and deserializes an object received from the server.
|
JsonValue |
serialize(T value,
ApplicationConnection connection)
Serialize the given object into JSON.
|
T deserialize(Type type, JsonValue jsonValue, ApplicationConnection connection)
serialize(Object, ApplicationConnection) and
also with the server side JsonCodec.encode method.type - the type to deserializejsonValue - JSON map from property name to property valueconnection - the application connection providing the contextJsonValue serialize(T value, ApplicationConnection connection)
deserialize(Type, JsonValue, ApplicationConnection) and also
with the server side JsonCodec.decodeCustomType method.value - The object to serializeconnection - the application connection providing the contextCopyright © 2018 Vaadin Ltd. All rights reserved.