JSON format was introduced as a replacement for the XML format when the extensibility and verbosity of XML were not required and thus to lift the resource consumption of complex XML processing to let smaller devices consume streams of data or data packets produced by different services they needed to interact with.
Before the Java EE 7 specification there was no standard API to process JSON documents in Java but rather there were some open source projects such as google-gson, https://code.google.com/p/google-gson and Jackson, http://jackson.codehaus.org to manipulate JSON documents. With Java EE 7 and the addition of JSON-P to the arsenal, a standard API is added to Java EE to let the developers manipulate JSON documents in a standard fashion similar to XML processing of APIs.
The JSON-P API provides two parsing methods to parse JSON documents, the same two models that are available for parsing XML documents. The streaming event-based parsing and the...