Gson

from Wikipedia, the free encyclopedia

Gson (also known as Google Gson known) is an Open Source - Java - library with the Java objects in their JSON can be converted representation. It can also be used to convert a JSON string into a corresponding Java object.

Gson was originally developed for internal use by Google , version 1.0 was later released on May 22, 2008 under the Apache license 2.0 for the general public. The latest version, 2.8.6, was released on October 4, 2019.

Features

  • Gson can handle collections, generic types, and nested classes (including inner classes, but this cannot be done by default)
  • During de- serialization , Gson navigates through the type tree of the object to be deserialized. This results in additional fields that are present in the JSON input being ignored.
  • The user can write a custom serializer and / or deserializer so that they can control the whole process and even (de) serialize instances of classes for which the source code is not accessible.
  • The user can write an InstanceCreator that enables him to deserialize instances of classes without a defined no-arg constructor.
  • Gson is highly customizable.

Web links