GWT 2.1.0

com.google.gwt.requestfactory.shared
Class ValueCodex

java.lang.Object
  extended by com.google.gwt.requestfactory.shared.ValueCodex

public class ValueCodex
extends java.lang.Object

Provides unified encoding and decoding of value objects.


Constructor Summary
ValueCodex()
           
 
Method Summary
static boolean canDecode(java.lang.Class<?> clazz)
          Returns true if ValueCodex can operate on values of the given type.
static
<T> T
convertFromString(java.lang.Class<T> clazz, java.lang.String encoded)
          Convert an encoded representation of a value into a value.
static java.lang.String encodeForJsonPayload(java.lang.Object obj)
          Convert a value into an encoded string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueCodex

public ValueCodex()
Method Detail

canDecode

public static boolean canDecode(java.lang.Class<?> clazz)
Returns true if ValueCodex can operate on values of the given type.


convertFromString

public static <T> T convertFromString(java.lang.Class<T> clazz,
                                      java.lang.String encoded)
Convert an encoded representation of a value into a value.

Type Parameters:
T - the type of value desired
Parameters:
clazz - the type of value desired
encoded - the encoded representation of the value
Returns:
the value
Throws:
java.lang.IllegalArgumentException - if clazz is not a supported value type

encodeForJsonPayload

public static java.lang.String encodeForJsonPayload(java.lang.Object obj)
Convert a value into an encoded string representation.

Parameters:
obj - the value to encode
Returns:
an encoded representation of the object
Throws:
java.lang.IllegalArgumentException - if obj is not of a supported type

GWT 2.1.0