© Jeff Friesen 2016

JEFF FRIESEN, Java XML and JSON, 10.1007/978-1-4842-1916-4_9

9. Parsing and Creating JSON Objects with Gson

Jeff Friesen

(1)Dauphin, Manitoba, Canada

Gson is another API for for parsing and creating JSON objects. This chapter explores the latest version of this open source Google product.

What Is Gson ?

Gson (also known as Google Gson) is a small Java-based library for parsing and creating JSON objects. Google developed Gson for its own projects, but later made Gson publicly available, starting with version 1.0. According to Wikipedia, the latest version (at the time of writing) is 2.6.1.

Gson was developed with the following goals in mind:

  • Provide simple toJson() and fromJson() methods to convert Java objects to JSON objects and ...

Get Java XML and JSON now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.