com.amazonaws.util.json
Class JSONUtils

java.lang.Object
  extended by com.amazonaws.util.json.JSONUtils

public class JSONUtils
extends java.lang.Object


Constructor Summary
JSONUtils()
           
 
Method Summary
static
<T> T
toObject(java.lang.Class<T> clazz, java.lang.String source)
          Load a JSON string into an instantiated object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JSONUtils

public JSONUtils()
Method Detail

toObject

public static <T> T toObject(java.lang.Class<T> clazz,
                             java.lang.String source)
                  throws JSONException
Load a JSON string into an instantiated object. All the public fields of the object will be set by the values in the JSON string associated with the field name.
Because of the naming convention in Java, the first letter of the field name will be capitalized for another look-up in the JSON, if the original field name is not found.

Parameters:
clazz - Class of the object which the JSON string would be loaded into.
source - JSON string.
Returns:
An instantiated object of the given Class
Throws:
JSONException


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.