Skip to Content
RESTful Java Web Services - Third Edition
book

RESTful Java Web Services - Third Edition

by Balachandar Bogunuva Mohanram
November 2017
Intermediate to advanced
420 pages
10h 29m
English
Packt Publishing
Content preview from RESTful Java Web Services - Third Edition

Using Jackson streaming APIs to parse JSON data

The following example illustrates Jackson streaming APIs for reading JSON data. This example uses streaming APIs to generate a Java model for the JSON array of employee objects. As in the earlier examples, the emp-array.json file is used as the input source. The steps are as follows:

  1. Create the com.fasterxml.jackson.core.JsonParser instance by using com.fasterxml.jackson.core.JsonFactory. The JsonParser class reads the JSON content from the file input stream.
  2. The next step is to start parsing the JSON content read from the input source. The client may call the nextToken() method to forward the stream enough to determine the type of the next token. Based on the token type, the client can take ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

RESTful Java Web Services, Second Edition

RESTful Java Web Services, Second Edition

Jobinesh Purushothaman
Java Web Services

Java Web Services

David A Chappell, Tyler Jewell

Publisher Resources

ISBN: 9781788294041Supplemental Content