|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.paypal.base.rest.JSONFormatter
public final class JSONFormatter
JSONFormatter converts objects to JSON representation and vice-versa. This class depends on Google's GSON library to do the transformation. This class is not thread-safe.
| Field Summary | |
|---|---|
static com.google.gson.Gson |
GSON
Gson |
| Method Summary | ||
|---|---|---|
static
|
fromJSON(String responseString,
Class<T> clazz)
Converts a JSON String to object representation |
|
static void |
setFIELD_NAMING_POLICY(com.google.gson.FieldNamingPolicy FIELD_NAMING_POLICY)
Set a format for gson FIELD_NAMING_POLICY. |
|
static
|
toJSON(T t)
Converts a Raw Type to JSON String |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static com.google.gson.Gson GSON
| Method Detail |
|---|
public static final void setFIELD_NAMING_POLICY(com.google.gson.FieldNamingPolicy FIELD_NAMING_POLICY)
FieldNamingPolicy
FIELD_NAMING_POLICY - public static <T> String toJSON(T t)
T - Type to be convertedt - Object of the type
public static <T> T fromJSON(String responseString,
Class<T> clazz)
T - Type to be convertedresponseString - JSON representationclazz - Target class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||