In this post, under GSON, I will explain how to use custom date format when serializing Java object containing date information to json format. We can change this format globally, globally meaning the custom format will be applied to all objects that are serialized using Gson instance, created using the custom date format. Below is…… Continue reading Using Custom DateFormat
Month: August 2019
Configuring Gson object
In this post under GSON, I will explain how to configure the Gson instance. In all my previous post under GSON, I used to create a Gson instance by using the below code snippet. Gson gson = new Gson(); With this instance we used convert java object to and from JSON format. This instance comes…… Continue reading Configuring Gson object
Writing JSON Data using JsonWriter
This post explains how to write json data to a file using JsonWriter. With JsonWriter we dont need to build the entire object in memory. The code explains how to write the below json data [ { “id”: 1, “text”: “text1”, “array”: null }, { “id”: 2, “text”: “text2!”, “array”: [ 50.454722, -104.606667 ] }…… Continue reading Writing JSON Data using JsonWriter