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:
- 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.
- 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 ...