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.
Parse JSON data
- [Instructor] Okay, let's get started by writing code that passes the json document that we have been using throughout this course. Okay, so let's open the streaming example one class from the exercise files. And as you can see, I have already created a method called pause json string. This is where we are going to write the pausing logic. I also assigned the json data into a string variable called json. Ready for us to stream. Firstly, we create the passer from the static factory method in the json class. And pass it an instance of the reader object. So, let's do that. So as before, we start without json passer. Like so. And then from the json class, we call a factory method. And from that factory method we pass in a string reader. And into that string reader, we pass the string that we want to pass just as we had done before. In this case, a simple string reader instance is sufficient for our purposes. Nevertheless, you could just as easily pass it an input stream instead. Now we…
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)
-