com.vaadin.client.communication.

Interface JSONSerializer<T>

    • Method Summary

      All Methods
      Modifier and Type Method Description
      T deserialize​(Type type, elemental.json.JsonValue jsonValue, ApplicationConnection connection)

      Creates and deserializes an object received from the server.

      elemental.json.JsonValue serialize​(T value, ApplicationConnection connection)

      Serialize the given object into JSON.

    • Method Detail

      • deserialize

        T deserialize​(Type type,
                      elemental.json.JsonValue jsonValue,
                      ApplicationConnection connection)

        Creates and deserializes an object received from the server. Must be compatible with serialize(Object, ApplicationConnection) and also with the server side JsonCodec.encode method.

        Parameters:

        type - the type to deserialize

        jsonValue - JSON map from property name to property value

        connection - the application connection providing the context

        Returns:

        A deserialized object

      • serialize

        elemental.json.JsonValue serialize​(T value,
                                           ApplicationConnection connection)

        Serialize the given object into JSON. Must be compatible with deserialize(Type, JsonValue, ApplicationConnection) and also with the server side JsonCodec.decodeCustomType method.

        Parameters:

        value - The object to serialize

        connection - the application connection providing the context

        Returns:

        A JSON serialized version of the object