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 streaming model
From the course: JSON Processing with Java EE
Introduction to the streaming model
- [Instructor] The streaming model reads JSON data one element at a time and fires an event each time it reaches one of the following elements: The start and end of an object, the start and end of an array, a key name, and any string, number, Boolean, and NULL value. The parser stops at each event. It can then either process the element or discard it. It moves on to the next event until all elements in the JSON data stream have been parsed. This is very efficient low-level API designed for passing large quantities of JSON data. API consists of two principal interfaces, JsonParser and JsonGenerator. Both interfaces are located in the Javax.json.stream package. The JsonParser interface provides read-only access to the JSON data as it parses it. It traverses in the forward direction only. The next element in the JSON document is pulled by calling the next method in the parser interface. This continues until the data is exhausted. The JsonGenerator interface provides a collection of…
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 streaming model2m 43s
-
(Locked)
Parse JSON data6m 47s
-
(Locked)
Write JSON data2m 3s
-
(Locked)
Challenge: Find the value of a JSON key34s
-
(Locked)
Solution: Find the value of a JSON key32s
-
(Locked)
Challenge: Output JSON object to a file22s
-
(Locked)
Solution: Output JSON object to file13s
-
(Locked)
-