From the course: Java EE 8 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Streaming parser values

Streaming parser values - Java EE Tutorial

From the course: Java EE 8 Essential Training

Start my 1-month free trial

Streaming parser values

- [Instructor] In this lesson, we'll see how to use the JSON parser in order to retrieve the values for the different properties in our JSON document. So, right now we're iterating through all of the events within our JSON document. Not all of them are extremely important to us. So, we're going to go ahead and build a switch statement, that is going to inspect each event, and then we can handle those events which are important. So we can take a look at the key name event and this is going to be the name of a property. Once we see that we have a property or a key name within our JSON parser, we can go ahead and use the parser to get the particular value for that key name. And we just use the get string method. It will type the result of the parser. And then we can go look for other cases. So we can also have a value string. So this is going to be a property value within a JSON document and we can also send these to the…

Contents