Gson Tutorial

Discuss Gson

Discuss Gson Advertisements Previous Page Next Page   Google Gson is an open source, Java-based library developed by Google. It facilitates serialization of Java objects to JSON and vice versa. This tutorial adopts a simple and intuitive way to describe the basic-to-advanced concepts of Google Gson and how to use its APIs. Previous Page Print…

Gson – Useful Resources

Gson – Useful Resources Advertisements Previous Page Next Page   The following resources contain additional information on Gson JSON Processor library. Please use them to get more in-depth knowledge on this topic. Useful Links on Gson Google Gson Project Home − Google Gson Project Home page Google Gson Wiki − Wikipedia Reference for Google Gson…

Gson – Quick Guide

Gson – Quick Guide Advertisements Previous Page Next Page   Gson – Overview Google Gson is a simple Java-based library to serialize Java objects to JSON and vice versa. It is an open-source library developed by Google. The following points highlight why you should be using this library − Standardized − Gson is a standardized…

Gson – Excluding fields from Serialization

Gson – Excluding fields from Serialization Advertisements Previous Page Next Page   By default, GSON excludes transient and static fields from the serialization/deserialization process. Let’s take a look at the following example. Example Create a Java class file named GsonTester in C:>GSON_WORKSPACE. File − GsonTester.java import com.google.gson.Gson; import com.google.gson.GsonBuilder; public class GsonTester { public static…

Gson – Null Object Support

Gson – Null Object Support Advertisements Previous Page Next Page   Gson by default generates optimized Json content ignoring the NULL values. But GsonBuilder provides flags to show NULL values in the Json output using the GsonBuilder.serializeNulls() method. GsonBuilder builder = new GsonBuilder(); builder.serializeNulls(); Gson gson = builder.create(); Example without serializeNulls Call Create a Java…