JSON is built on two structures:
- A collection of name/value pairs. In various languages, this is realized as an object, record, struct, dictionary, hash table, keyed list, or associative array.
- An ordered list of values. In most languages, this is realized as an array, vector, list, or sequence.
A High-performance JSON processor.
1st Java JSON Tutorial: Convert Java Object to/from JSON using JACKSON API
Java Json Example to use ObjectMapper writeValue() and readValue() to convert Java object to / from JSON.
2nd Java JSON Tutorial: Json Tree Model Example using Jackson API
Java Json Example to read/write JSON Tree using Tree Model
4th Java JSON Tutorial: Jackson Json Annotation Example
Java Json Example to use Jackson Json Annotation
5th JSON Tutorial: Pretty print JSON in Java
Java Json Example to use ObjectMapper to pretty print JSON.
Gson (also known as Google Gson) is an open source Java library to serialize and deserialize Java objects to (and from) JSON. It was originally created for use inside Google, now it is used by many public projects.
1st Java JSON Tutorial: Convert Java collections into JSON and JSON to collections
Java Json Example to use toJson() and fromJson() to convert Java Object to / from JSON.
2nd Java JSON Tutorial: Parse json string and java object into Gson tree model
Java Json Example to use JsonParser and GsonBuilder to create Gson tree model
3rd Java JSON Tutorial: Read & write file using Gson streaming
Java Json Example to use JsonWriter() and JsonReader () to stream read and write JSON data.
4th Java JSON Tutorial: GSON Annotations Example
Java Json Example to use GSON annotation
5th JSON Tutorial: GSON Annotations Example using JsonAdapter
Java Json Example to use GSON annotation with JsonAdapter
6th JSON Tutorial: JSON pretty print using Gson
Example to use GsonBuilder to pretty print Json string