GSON Annotations Example using JsonAdapter

This tutorial shows you how to create GSON Annotations Example using JsonAdapter. The @JsonAdapter annotation is one of userful GSON annotations. This annotation be used at field or class level to specify the Gson TypeAdapter for serializing or deserializing. GSON converts java classes to JSON using its built-in type adapters by default. Sometimes, They doesn’t … Read more

GSON Annotations Example

Gson Annotations Example shows you some useful annotations that are provided by Google Gson, for example: @Expose, @SerializedName, @Since, @Until, and @JsonAdapter. With these annotations, we can customize the serialization of java object to JSON or desirialization of object from JSON. Table of contents: 1. Project structure 2. Maven Dependency 3. Create POJO with GSON … Read more

Parse json string and java object into Gson tree model

GSON Tree Model API provides JsonParser help you parse Json string to tree model of JsonElement. Beside, JsonElement provides method isJsonXXX() and getAsYYY() to check type of Json element and get value of element on that tree node. On the writing, Gson Tree Model API provides method toJsonTree help you converts a java object into … Read more

Please share it if you found this useful
Hide Buttons