In this example You will learn
how to parse a JSON String to Java and
how to convert Java Object to JSON format using Jackson. JSON stands for JavaScript Object notation is a subset of JavaScript object syntax, which allows all JavaScript client to process it without using any external library. Because of its compact size, compared to XML and platform independence nature makes JSON a favorite format for transferring data via HTTP. Though Java doesn't have any inbuilt support to parse JSON response in core library, Java developers are lucky to have couple of good and feature rich JSON processing libraries such as
GSON,
Jackson and
JSON-simple. Jackson in a high performance, one of the fasted JSON parsing library, which also provides streaming capability. It has no extenal dependency and solely depends on JDK. It is also powerful and provides full binding support for common JDK classes as well as any Java Bean class, e.g. Player in our case. It also provides data binding for Java Collection classes e.g.
Map as well
Enum.