Example usage for com.vaadin.client.communication JsonDecoder decodeValue

List of usage examples for com.vaadin.client.communication JsonDecoder decodeValue

Introduction

In this page you can find the example usage for com.vaadin.client.communication JsonDecoder decodeValue.

Prototype

public static Object decodeValue(Type type, JsonValue jsonValue, Object target,
        ApplicationConnection connection) 

Source Link

Document

Decode a JSON array with two elements (type and value) into a client-side type, recursively if necessary.

Usage

From source file:org.vaadin.alump.offlinebuilder.client.offline.OfflineFactory.java

License:Open Source License

protected SharedState decodeState(JSONValue jsonState, SharedState state, ApplicationConnection connection) {
    SharedState ret;/* w  w w  . j  av  a 2 s  .  co m*/

    try {
        ret = (SharedState) JsonDecoder.decodeValue(new Type(state.getClass().getName(), null), jsonState,
                state, connection);
    } catch (Exception e) {
        logger.log(Level.SEVERE, "JSON State decoding exception", e);
        logger.warning("Failed to decode state of component with JSON: " + jsonState.toString());
        ret = null;
    }
    return ret;
}