Gson
-
Core Java

Java JSON to POJO Conversion
JSON is a lightweight format used for data exchange between systems. In Java, mapping JSON to a POJO makes your…
Read More » -
Core Java

Deserialize to a Map with Correct Type Example
1. Introduction Deserialization is the process of converting data to Java objects. In this example, I will demonstrate how to…
Read More » -
Core Java

Gson @Expose vs @SerializedName
1. Introduction Gson @Expose and @SerializedName annotations are provided by the Gson library to control serialization and deserialization behavior when converting…
Read More » -
Core Java

Efficient JSON Parsing in Java: Jackson vs. Gson vs. JSON-B
Efficient JSON parsing is crucial for Java applications that handle data interchange. Three prominent libraries—Jackson, Gson, and JSON-B—offer robust solutions…
Read More » -
Enterprise Java

Spring MockMVC Get JSON As Object
1. Introduction Spring MockMVC is the Spring MVC testing framework which performs Spring MVC request handling and response asserting via…
Read More » -
Core Java

Read and Write JSON to File with GSON
1. Introduction Using GSON to read and write json to file is easy with the fromJson and toJson APIs. GSON…
Read More » -
Core Java

Gson Support for Java 8 Date-Time Types
Java 8 introduced a robust date and time API with classes such as LocalDate, LocalDateTime, and ZonedDateTime. These classes provide…
Read More » -
Core Java

How to exclude fields in Gson
Google Gson is a library for serializing and deserializing Java objects to and from JSON. Sometimes, it is necessary to…
Read More » -
Core Java

Custom Field Names with @SerializedName in Gson
Gson is a popular Java library for converting Java objects to their JSON representation and vice versa. One of the…
Read More »


