List of usage examples for com.vaadin.server JsonCodec encode
public static EncodeResult encode(Object value, JsonValue diffState, Type valueType, ConnectorTracker connectorTracker)
From source file:annis.libgui.Helper.java
License:Apache License
public static <T> JsonValue encodeGeneric(Object v) { return JsonCodec.encode(v, null, v.getClass().getGenericSuperclass(), null).getEncodedValue(); }
From source file:de.elomagic.vaadin.addon.networkgraph.NetworkGraph.java
License:Apache License
private Object encodeObject(Object o) { try {// www . j a v a2 s . c o m EncodeResult result = JsonCodec.encode(o, null, o.getClass(), null); return result.getEncodedValue(); } catch (JSONException e) { throw new RuntimeException(e); } }