com.google.gson.Gson class to convert Json to Java and
vice-versa.
The primary class to use is com. which can be constructed with new Gson() (using default settings) or by using com. (to
configure various options such as using versioning and so on).
| Modifier and Type | Interface and Description |
|---|---|
| public interface | ExclusionStrategy
A strategy (or policy) definition that is used to decide whether or not a field or class should be serialized or deserialized as part of the JSON output/input. |
| public interface | FieldNamingStrategy
A mechanism for providing custom field naming in Gson. |
| public interface | InstanceCreator<
the type of object that will be created by this implementation. T>This interface is implemented to create instances of a class that does not define a no-args constructor. |
| public interface | JsonDeserializationContext
Context for deserialization that is passed to a custom deserializer during invocation of its
|
| public interface | JsonDeserializer<
type for which the deserializer is being registered. It is possible that a
deserializer may be asked to deserialize a specific generic type of the T. T>Interface representing a custom deserializer for JSON. |
| public interface | JsonSerializationContext
Context for serialization that is passed to a custom serializer during invocation of its |
| public interface | JsonSerializer<
type for which the serializer is being registered. It is possible that a serializer
may be asked to serialize a specific generic type of the T. T>Interface representing a custom serializer for JSON. |
| public interface | ReflectionAccessFilter
Filter for determining whether reflection based serialization and deserialization is allowed for a class. |
| public interface | ToNumberStrategy
A strategy that is used to control how numbers should be deserialized for |
| public interface | TypeAdapterFactory
Creates type adapters for set of related types. |
| Modifier and Type | Class and Description |
|---|---|
| public class | FieldAttributes
A data object that stores attributes of a field. |
| public class | FormattingStyle
A class used to control what the serialization output looks like. |
| public class | Gson
This is the main class for using Gson. |
| public class | GsonBuilder
Use this builder to construct a |
| public class | JsonArray
A class representing an array type in JSON. |
| public abstract class | JsonElement
A class representing an element of JSON. |
| public class | JsonIOException
This exception is raised when Gson was unable to read an input stream or write to one. |
| public class | JsonNull
A class representing a JSON |
| public class | JsonObject
A class representing an object type in JSON. |
| public class | JsonParseException
This exception is raised if there is a serious issue that occurs during parsing of a Json string. |
| public class | JsonParser
A parser to parse JSON into a parse tree of |
| public class | JsonPrimitive
A class representing a JSON primitive value. |
| public class | JsonStreamParser
A streaming parser that allows reading of multiple |
| public class | JsonSyntaxException
This exception is raised when Gson attempts to read (or write) a malformed JSON element. |
| public abstract class |
| Modifier and Type | Enum and Description |
|---|---|
| public enum | FieldNamingPolicy
An enumeration that defines a few standard naming conventions for JSON field names. |
| public enum | LongSerializationPolicy
Defines the expected format for a |
| public enum | Strictness
Modes that indicate how strictly a JSON reader or writer follows the syntax laid out in the RFC 8259 JSON specification. |
| public enum | ToNumberPolicy
An enumeration that defines two standard number reading strategies and a couple of strategies to
overcome some historical Gson limitations while deserializing numbers as |