com.vaadin.terminal.gwt.client.communication
Class JsonEncoder

java.lang.Object
  extended by com.vaadin.terminal.gwt.client.communication.JsonEncoder

public class JsonEncoder
extends Object

Encoder for converting RPC parameters and other values to JSON for transfer between the client and 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

Field Summary
static String VTYPE_ARRAY
           
static String VTYPE_BOOLEAN
           
static String VTYPE_CONNECTOR
           
static String VTYPE_DOUBLE
           
static String VTYPE_FLOAT
           
static String VTYPE_INTEGER
           
static String VTYPE_LIST
           
static String VTYPE_LONG
           
static String VTYPE_MAP
           
static String VTYPE_NULL
           
static String VTYPE_SET
           
static String VTYPE_STRING
           
static String VTYPE_STRINGARRAY
           
 
Constructor Summary
JsonEncoder()
           
 
Method Summary
static com.google.gwt.json.client.JSONValue encode(Object value, boolean restrictToInternalTypes, ApplicationConnection connection)
          Encode a value to a JSON representation for transport from the client to the server.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VTYPE_CONNECTOR

public static final String VTYPE_CONNECTOR
See Also:
Constant Field Values

VTYPE_BOOLEAN

public static final String VTYPE_BOOLEAN
See Also:
Constant Field Values

VTYPE_DOUBLE

public static final String VTYPE_DOUBLE
See Also:
Constant Field Values

VTYPE_FLOAT

public static final String VTYPE_FLOAT
See Also:
Constant Field Values

VTYPE_LONG

public static final String VTYPE_LONG
See Also:
Constant Field Values

VTYPE_INTEGER

public static final String VTYPE_INTEGER
See Also:
Constant Field Values

VTYPE_STRING

public static final String VTYPE_STRING
See Also:
Constant Field Values

VTYPE_ARRAY

public static final String VTYPE_ARRAY
See Also:
Constant Field Values

VTYPE_STRINGARRAY

public static final String VTYPE_STRINGARRAY
See Also:
Constant Field Values

VTYPE_MAP

public static final String VTYPE_MAP
See Also:
Constant Field Values

VTYPE_LIST

public static final String VTYPE_LIST
See Also:
Constant Field Values

VTYPE_SET

public static final String VTYPE_SET
See Also:
Constant Field Values

VTYPE_NULL

public static final String VTYPE_NULL
See Also:
Constant Field Values
Constructor Detail

JsonEncoder

public JsonEncoder()
Method Detail

encode

public static com.google.gwt.json.client.JSONValue encode(Object value,
                                                          boolean restrictToInternalTypes,
                                                          ApplicationConnection connection)
Encode a value to a JSON representation for transport from the client to the server.

Parameters:
value - value to convert
connection -
Returns:
JSON representation of the value


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