com.vaadin.client.communication
Class JsonDecoder

java.lang.Object
  extended by com.vaadin.client.communication.JsonDecoder

public class JsonDecoder
extends java.lang.Object

Client side decoder for decodeing shared state and other values from JSON received from the server. Currently, basic data types as well as Map, String[] and Object[] are supported, where maps and Object[] can contain other supported data types. TODO extensible type support

Since:
7.0

Constructor Summary
JsonDecoder()
           
 
Method Summary
static java.lang.Object decodeValue(Type type, elemental.json.JsonValue jsonValue, java.lang.Object target, ApplicationConnection connection)
          Decode a JSON array with two elements (type and value) into a client-side type, recursively if necessary.
static
<T extends elemental.json.JsonValue>
T
obj2jso(java.lang.Object object)
          Called by generated deserialization code to treat a generic object as a JsonValue.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonDecoder

public JsonDecoder()
Method Detail

decodeValue

public static java.lang.Object decodeValue(Type type,
                                           elemental.json.JsonValue jsonValue,
                                           java.lang.Object target,
                                           ApplicationConnection connection)
Decode a JSON array with two elements (type and value) into a client-side type, recursively if necessary.

Parameters:
jsonValue - JSON value with encoded data
connection - reference to the current ApplicationConnection
Returns:
decoded value (does not contain JSON types)

obj2jso

public static <T extends elemental.json.JsonValue> T obj2jso(java.lang.Object object)
Called by generated deserialization code to treat a generic object as a JsonValue. This is needed because GWT refuses to directly cast String typed as Object into a JSO.



Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.