com.amazonaws.util.json
Class JSONUtils
java.lang.Object
com.amazonaws.util.json.JSONUtils
public class JSONUtils
- extends Object
Method Summary |
static
|
toObject(Class<T> clazz,
String source)
Load a JSON string into an instantiated object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JSONUtils
public JSONUtils()
toObject
public static <T> T toObject(Class<T> clazz,
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 © 2016. All rights reserved.