Java Gson Tutorial
In this Java Gson tutorial we learn how to use the Gson library.
In this Java Gson tutorial we learn how to use the Gson library.
In this Java Gson tutorial we learn how to use the com.google.gson.reflect.TypeToken during deserializing JSON String with Gson library.
In this Java Gson tutorial we learn how to @Since annotation to support versioning during serialization or deserialize JSON with Gson library.
In this Java Gson tutorial we learn how to configure Gson to customize the field name during serialization JSON. Via step by step tutorial we will show you how to use the @SerializedName annotation to override field names.
In this Java Gson tutorial we learn how to configure Gson to enable serializing null fields during serialization JSON. Via step by step tutorial we will show you how to use the GsonBuilder.serializeNulls() method to configure Gson to serialize null fields.
In this Java Gson tutorial we learn how to exclude fields during serialization or deserialize JSON by using the ExclusionStrategy interface. Via step by step tutorial we will show you how to use the GsonBuilder.setExclusionStrategies() method and com.google.gson.ExclusionStrategy interface to configure Gson to exclude fields based on custom implementation.
In this Java Gson tutorial we learn how to exclude fields during serialization or deserialize JSON to exclude fields based on @Expose annotation. Via step by step tutorial we will show you how to use the GsonBuilder.excludeFieldsWithoutExposeAnnotation() method to configure Gson to exclude fields without @Expose annotation.
In this tutorial we learn how to configure Gson to exclude fields during serialization or deserialize JSON to exclude fields with specific access modifiers. Via step by step example we will show you how to use the GsonBuilder.excludeFieldsWithModifiers() method to override Gson configuration to exclude fields by given modifiers.
In this Java Gson tutorial we learn how to use the com.google.gson.stream.JsonReader class of Gson library to read JSON file content.
In this Java Gson tutorial we learn how to use the JsonWriter class in the Gson library to write JSON content to file. Via different Java example programs we show you how to write a simple JSON object to file, a multi level JSON content or an array of objects to JSON file.