What is JSON?
- JavaScript Object Notation
- Lightweight data format for storing and exchanging data
- JSON is plain text data
JSON Example
1 | { |
JSON Data Binding
- Data binding is the process of converting JSON data to a Java POJO, also know as Mapping, Serialization/Deserialization, Marshalling/Unmarshalling
JSON Data Binding with Jackson
- Spring uses the Jackson Project behind the scenes
- Jackson handles data binding between JSON and Java POJO
- By default, Jackson will call appropriate getter/setter method
- JSON to Java POJO
- call setter methods on POJO(automatically)
- Java POJO to JSON
- call getter methods on POJO(automatically)
- JSON to Java POJO