public class GsonHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
<T> T |
fromJson(com.google.gson.JsonElement json,
Class<T> classOfT) |
<T> T |
fromJson(com.google.gson.JsonElement json,
Type typeOfT) |
<T> T |
fromJson(com.google.gson.stream.JsonReader reader,
Type typeOfT) |
<T> T |
fromJson(Reader json,
Class<T> classOfT) |
<T> T |
fromJson(Reader json,
Type typeOfT) |
<T> T |
fromJson(String json,
Class<T> classOfT) |
<T> T |
fromJson(String json,
Type typeOfT) |
<T> T |
fromJson(String json,
com.google.gson.reflect.TypeToken<T> typeOfT) |
<T> com.google.gson.TypeAdapter<T> |
getAdapter(Class<T> type) |
<T> com.google.gson.TypeAdapter<T> |
getAdapter(com.google.gson.reflect.TypeToken<T> type) |
<T> com.google.gson.TypeAdapter<T> |
getDelegateAdapter(com.google.gson.TypeAdapterFactory skipPast,
com.google.gson.reflect.TypeToken<T> type) |
static GsonHelper |
getInstance()
get the GsonHelper singleton instance
|
void |
setPrettyPrinting(boolean usePrettyPrinting) |
String |
toJson(com.google.gson.JsonElement jsonElement) |
void |
toJson(com.google.gson.JsonElement jsonElement,
Appendable writer) |
void |
toJson(com.google.gson.JsonElement jsonElement,
com.google.gson.stream.JsonWriter writer) |
String |
toJson(Object src) |
void |
toJson(Object src,
Appendable writer) |
String |
toJson(Object src,
Type typeOfSrc) |
void |
toJson(Object src,
Type typeOfSrc,
Appendable writer) |
void |
toJson(Object src,
Type typeOfSrc,
com.google.gson.stream.JsonWriter writer) |
com.google.gson.JsonElement |
toJsonTree(Object src) |
com.google.gson.JsonElement |
toJsonTree(Object src,
Type typeOfSrc) |
String |
toString() |
public static GsonHelper getInstance()
public void setPrettyPrinting(boolean usePrettyPrinting)
public <T> T fromJson(String json, com.google.gson.reflect.TypeToken<T> typeOfT) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxExceptionpublic <T> com.google.gson.TypeAdapter<T> getAdapter(com.google.gson.reflect.TypeToken<T> type)
public <T> com.google.gson.TypeAdapter<T> getDelegateAdapter(com.google.gson.TypeAdapterFactory skipPast,
com.google.gson.reflect.TypeToken<T> type)
public <T> com.google.gson.TypeAdapter<T> getAdapter(Class<T> type)
public com.google.gson.JsonElement toJsonTree(Object src)
public void toJson(Object src, Appendable writer) throws com.google.gson.JsonIOException
com.google.gson.JsonIOExceptionpublic void toJson(Object src, Type typeOfSrc, Appendable writer) throws com.google.gson.JsonIOException
com.google.gson.JsonIOExceptionpublic void toJson(Object src, Type typeOfSrc, com.google.gson.stream.JsonWriter writer) throws com.google.gson.JsonIOException
com.google.gson.JsonIOExceptionpublic String toJson(com.google.gson.JsonElement jsonElement)
public void toJson(com.google.gson.JsonElement jsonElement,
Appendable writer)
throws com.google.gson.JsonIOException
com.google.gson.JsonIOExceptionpublic void toJson(com.google.gson.JsonElement jsonElement,
com.google.gson.stream.JsonWriter writer)
throws com.google.gson.JsonIOException
com.google.gson.JsonIOExceptionpublic <T> T fromJson(String json, Class<T> classOfT) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxExceptionpublic <T> T fromJson(String json, Type typeOfT) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxExceptionpublic <T> T fromJson(Reader json, Class<T> classOfT) throws com.google.gson.JsonSyntaxException, com.google.gson.JsonIOException
com.google.gson.JsonSyntaxExceptioncom.google.gson.JsonIOExceptionpublic <T> T fromJson(Reader json, Type typeOfT) throws com.google.gson.JsonIOException, com.google.gson.JsonSyntaxException
com.google.gson.JsonIOExceptioncom.google.gson.JsonSyntaxExceptionpublic <T> T fromJson(com.google.gson.stream.JsonReader reader,
Type typeOfT)
throws com.google.gson.JsonIOException,
com.google.gson.JsonSyntaxException
com.google.gson.JsonIOExceptioncom.google.gson.JsonSyntaxExceptionpublic <T> T fromJson(com.google.gson.JsonElement json,
Class<T> classOfT)
throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxExceptionpublic <T> T fromJson(com.google.gson.JsonElement json,
Type typeOfT)
throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxExceptionCopyright © 2015. All rights reserved.