From the course: JSON Processing with Java EE
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Introduction to the object model
From the course: JSON Processing with Java EE
Introduction to the object model
- [Instructor] The JSON P model is a memory-based model, which loads the entire JSON document into memory. As it is loaded, it is parsed into a JSON object structure, with the JsonValue class at the top. All classes related to the object model are located in the the JSON X dot JSON package and consists of the following principle APIs. JsonBuilder, JsonReader, and JsonWriter. As you can see from the tree diagram of the class structure, every value in the model is of type JsonValue. More specific types are defined as JsonObject or JsonArray. These three types are the only types necessary to represent all of the possible data types in a JSON document. So, JsonObject represent a JSON object. The JsonArray represents a JSON array. And all other values, such as string and number, are represented by JsonValue. As mentioned in a previous video, the JsonObject class implements a map and the JsonArray implements a list interface. What this means is that the normal functionality of maps and…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Introduction to the object model2m 44s
-
(Locked)
Create a model from a JSON string6m 48s
-
(Locked)
Create a model from a JSON file2m 48s
-
(Locked)
JSON builder API1m 24s
-
Build a JSON model8m 30s
-
(Locked)
How to traverse the model1m 36s
-
(Locked)
Traverse the JSON model6m 19s
-
(Locked)
Output the JSON model to a data stream3m 16s
-
(Locked)
Challenge: JSON array object30s
-
(Locked)
Solution: JSON array object1m 11s
-
(Locked)
Challenge: Write unit test27s
-
(Locked)
Solution: Write unit test23s
-
(Locked)
Challenge: Output JSON object to a file18s
-
(Locked)
Solution: Output JSON object to a file36s
-
(Locked)
-
-