Gson is a Java library that can be used to convert Java Objects into their JSON representation.

Overview

Gson is a Java library that can be used to convert Java Objects into their JSON representation. It can also be used to convert a JSON string to an equivalent Java object. Gson is an open-source project hosted at http://code.google.com/p/google-gson.

Gson can work with arbitrary Java objects including pre-existing objects that you do not have source-code of.

Goals for Gson

  • Provide easy to use mechanisms like toString() and constructor (factory method) to convert Java to JSON and vice-versa
  • Allow pre-existing unmodifiable objects to be converted to and from JSON
  • Allow custom representations for objects
  • Support arbitrarily complex object
  • Generate compact and readability JSON output
發佈了159 篇原創文章 · 獲贊 10 · 訪問量 45萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章