Simple Solution
  • Java
  • Spring
  • Spring Boot
  • Tutorials
  • Tags

Java Gson Tutorial

Tags: Gson Tutorial JSON

In this Java Gson tutorial we learn how to use the Gson library.

Serializes Java Object to JSON String

  • How to convert Java object to JSON String

  • How to generate Pretty Print JSON String

  • Gson.toJson() code examples

Deserializes JSON String to Java Object

  • How to convert JSON String to Java object

  • How to convert JSON String to JsonElement object

  • How to use TypeToken class

  • Gson.fromJson() code examples

Read JSON Files

  • How to convert JSON file to Java object

  • How to read JSON File using JsonReader class

  • How to convert classpath resource JSON File to Java Object

Write JSON Files

  • How to convert Java Object to JSON File

  • How to write JSON file using JsonWriter class

  • Spring Boot Web Application Export and Download JSON File

Exclude Fields
  • How to exclude fields using ExclusionStrategy interface

  • How to exclude fields using @Expose annotation

  • How to exclude fields with modifiers

Custom Field Name

  • How to custom field name using @SerializedName annotation

Versioning Support

  • Versioning support using @Since annotation

Null Field Support

  • How to enable serialize null fields

Others

  • Top 5 Libraries for Serialization and Deserialization JSON

Happy Coding 😊

Copyright © 2019 SimpleSolution.dev. All Rights Reserved.