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

Parse JSON data

From the course: JSON Processing with Java EE

Start my 1-month free trial

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…

Contents