JSON enhancements in Java EE allow for working with JSON in a much simpler way than before. The addition of JSON processing and binding has turned it into a first-class citizen of Java EE. Use APIs to serialize and deserialize Java objects, to and from JSON documents. JSON-B does for JSON, what JAXB did for XML. No longer do you have to rely upon third-party libraries to work with JSON. Most features will work out of the box, with sensible defaults.
We will cover the following topics in this chapter:
- REST prefers JSON
- JSON first-class citizen
- No more third-party libraries
- JSON processing:
- JSON-P 1.1
- JSON pointer and JSON patch
- JSON merge patch
- JSON collectors
- JSON binding:
- Similar to JAXB with default mappings
- Standardize current solutions (Jackson, Gson, and so on)
- Mapping between classes and JSON
- Customisation APIs
- A few tips in practice ...