JSON
CS 240 – Advanced Programming Concepts
Structure of JSON Documents
2
Parsing JSON Data
3
JSON Parsing Examples
4
JSON Parsing Examples (cont.)
5
Generating JSON Data
6
JSON Generation Examples
7
JSON Generation Examples (cont.)
8
Making Gson Available to Your Project
Three Ways:
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
</dependency>
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
Gson Type Adapters
10
Type Adapter Example: Standard �Type Adapter
11
Type Adapter Example: Deserializer
12
Type Adapter Example: RuntimeTypeAdapter