JSON-P 1.1

JSON-P 1.0, which was introduced in Java EE 7, shipped a powerful feature to programmatically create and read JSON structures. The version 1.1 mainly included support for common JSON standards.

One of these IETF standards is JSON Pointer (RFC 6901). It defines a syntax to query JSON structures and values. By using pointers such as "/0/user/address", JSON values are referenced, similarly to XPath in the XML world.

This feature is included in the JsonPointer type, that is created via the Json.createPointer() method, similarly to the existing JSON-P API.

Another, newly-supported standard is JSON Patch (RFC 6902). RFC 6902 defines so-called patches and modification methods that are applied to existing JSON structures.

JSON 1.1 supports creating JSON patches via Json.createPatch or Json.createPatchBuilder, respectively. The corresponding JSON-P type is JsonPatch.

The third supported IETF standard is JSON Merge Patch (RFC 7386). This standard merges existing JSON structures to create new structures. JSON-P supports creating Merge Patches via Json.createMergeDiff or Json.createMergePatch, respectively, that result in the JsonMergePatchtype.

Besides these supported IETF standards, JSON-P 1.1 includes a few smaller features that simplify the API usage. One example is the support of Java SE 8 streams via pre-defined stream collectors, such as the JsonCollectors.toJsonArray() method. Another small improvement enables the creation of JSON-P values types from Java strings and primitives, via Json.createValue.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.85.221