Jackson: Difference between revisions
Line 24: | Line 24: | ||
==Streaming API== | ==Streaming API== | ||
The Streaming API reads and writes JSON as a series of discrete events, in a mode called "incremental parsing/generation". The other two methods ([[#Tree_Model|Tree Model]] and [[#Data_Binding|Data Binding]]) are built in top of it. For more details, see {{Internal|Jackson Streaming API|Jackson Streaming API}} | The Streaming API reads and writes JSON as a series of discrete events, in a mode called "incremental parsing/generation". The other two methods ([[#Tree_Model|Tree Model]] and [[#Data_Binding|Data Binding]]) are built in top of it. For more details, see: {{Internal|Jackson Streaming API|Jackson Streaming API}} | ||
==Tree Model== | ==Tree Model== |
Revision as of 19:52, 25 February 2017
External
- Jackson Documentation Hub: https://github.com/FasterXML/jackson-docs
- Jackson JSON Processor Wiki http://wiki.fasterxml.com/JacksonHome
- Jackson in Five Minutes http://wiki.fasterxml.com/JacksonInFiveMinutes
- Jackson JSON Tutorial http://www.baeldung.com/jackson
- javadocs:
- Jackson Core https://github.com/FasterXML/jackson-core/wiki
- Jackson Core Annotations https://github.com/FasterXML/jackson-annotations/wiki
- Jackson Databind https://github.com/FasterXML/jackson-databind/wiki
Internal
Overview
Jackson is a Java library for processing JSON data format. It has support for marshaling and unmarshalling Java to and from JSON. It has a JAX-RS content handler that can automatically convert between Java objects and JSON, and vice-versa. It can generate JSON schemas from a Java object model.
JSON Processing Methods
Jackson offers three alternative methods for processing JSON:
Streaming API
The Streaming API reads and writes JSON as a series of discrete events, in a mode called "incremental parsing/generation". The other two methods (Tree Model and Data Binding) are built in top of it. For more details, see:
Tree Model
Tree model is arguably the most flexible of all three methods.
Data Binding
Data Binding is arguably the most convenient of all three methods.
JSON to Java
Java to JSON
TODO and delete: https://home.feodorov.com:9443/wiki/Wiki.jsp?page=Jackson
Maven Support
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.8.7</version> </dependency>