Java com.google.gson Gson fields, constructors, methods, implement or subclass

Example usage for Java com.google.gson Gson fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.google.gson Gson.

The text is from its open source code.

Subclass

com.google.gson.Gson has subclasses.
Click this link to see all its subclasses.

Field

Excluderexcluder
FieldNamingStrategyfieldNamingStrategy

Constructor

Gson()
Constructs a Gson object with default configuration.

Method

TfromJson(String json, Class classOfT)
This method deserializes the specified Json into an object of the specified class.
TfromJson(String json, Type typeOfT)
This method deserializes the specified Json into an object of the specified type.
TfromJson(Reader json, Class classOfT)
This method deserializes the Json read from the specified reader into an object of the specified class.
TfromJson(Reader json, Type typeOfT)
This method deserializes the Json read from the specified reader into an object of the specified type.
TfromJson(JsonReader reader, Type typeOfT)
Reads the next JSON value from reader and convert it to an object of type typeOfT .
TfromJson(JsonElement json, Class classOfT)
This method deserializes the Json read from the specified parse tree into an object of the specified type.
TfromJson(JsonElement json, Type typeOfT)
This method deserializes the Json read from the specified parse tree into an object of the specified type.
TypeAdaptergetAdapter(TypeToken type)
Returns the type adapter for type.
TypeAdaptergetAdapter(Class type)
Returns the type adapter for type.
TypeAdaptergetDelegateAdapter(TypeAdapterFactory skipPast, TypeToken type)
This method is used to get an alternate type adapter for the specified type.
JsonReadernewJsonReader(Reader reader)
Returns a new JSON reader configured for the settings on this Gson instance.
JsonWriternewJsonWriter(Writer writer)
Returns a new JSON writer configured for the settings on this Gson instance.
StringtoJson(Object src)
This method serializes the specified object into its equivalent Json representation.
StringtoJson(JsonElement jsonElement)
Converts a tree of JsonElement s into its equivalent JSON representation.
voidtoJson(Object src, Type typeOfSrc, Appendable writer)
This method serializes the specified object, including those of generic types, into its equivalent Json representation.
voidtoJson(Object src, Type typeOfSrc, JsonWriter writer)
Writes the JSON representation of src of type typeOfSrc to writer .
StringtoJson(Object src, Type typeOfSrc)
This method serializes the specified object, including those of generic types, into its equivalent Json representation.
voidtoJson(Object src, Appendable writer)
This method serializes the specified object into its equivalent Json representation.
voidtoJson(JsonElement jsonElement, Appendable writer)
Writes out the equivalent JSON for a tree of JsonElement s.
voidtoJson(JsonElement jsonElement, JsonWriter writer)
Writes the JSON for jsonElement to writer .
JsonElementtoJsonTree(Object src)
This method serializes the specified object into its equivalent representation as a tree of JsonElement s.
JsonElementtoJsonTree(Object src, Type typeOfSrc)
This method serializes the specified object, including those of generic types, into its equivalent representation as a tree of JsonElement s.
StringtoString()