GWT 2.2.0

com.google.gwt.autobean.shared
Class AutoBeanCodex

java.lang.Object
  extended by com.google.gwt.autobean.shared.AutoBeanCodex

public class AutoBeanCodex
extends java.lang.Object

Utility methods for encoding an AutoBean graph into a JSON-compatible string. This codex intentionally does not preserve object identity, nor does it encode cycles, but it will detect them.


Method Summary
static
<T> AutoBean<T>
decode(AutoBeanFactory factory, java.lang.Class<T> clazz, Splittable data)
           
static
<T> AutoBean<T>
decode(AutoBeanFactory factory, java.lang.Class<T> clazz, java.lang.String payload)
          Decode an AutoBeanCodex payload.
static Splittable encode(AutoBean<?> bean)
          Encodes an AutoBean.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

decode

public static <T> AutoBean<T> decode(AutoBeanFactory factory,
                                     java.lang.Class<T> clazz,
                                     Splittable data)

decode

public static <T> AutoBean<T> decode(AutoBeanFactory factory,
                                     java.lang.Class<T> clazz,
                                     java.lang.String payload)
Decode an AutoBeanCodex payload.

Type Parameters:
T - the expected return type
Parameters:
factory - an AutoBeanFactory capable of producing AutoBean<T>
clazz - the expected return type
payload - a payload string previously generated by encode(AutoBean)
Returns:
an AutoBean containing the payload contents

encode

public static Splittable encode(AutoBean<?> bean)
Encodes an AutoBean. The actual payload contents can be retrieved through Splittable.getPayload().

Parameters:
bean - the bean to encode
Returns:
a Splittable that encodes the state of the AutoBean

GWT 2.2.0