Jackson Simple Data Binding: Difference between revisions
Jump to navigation
Jump to search
Line 5: | Line 5: | ||
=Overview= | =Overview= | ||
Simple data binding extracts data from JSON and initializes a in-memory Java object hierarchy. Unlike the [[Jackson#Tree_Model|tree model]], which uses <tt>JsonNode</tt>s, simple data binding uses Maps, Lists, Strings, Numbers, Booleans and nulls to represent the JSON structure. | Simple data binding extracts data from JSON and initializes a in-memory Java object hierarchy. Unlike the [[Jackson#Tree_Model|tree model]], which uses <tt>JsonNode</tt>s, simple data binding uses Maps, Lists, Strings, Numbers, Booleans and nulls to represent the JSON structure. A Map/List/String/Number/Boolean hierarchy can be written out as JSON content. | ||
=JSON to Java= | =JSON to Java= |
Revision as of 19:40, 26 February 2017
Internal
Overview
Simple data binding extracts data from JSON and initializes a in-memory Java object hierarchy. Unlike the tree model, which uses JsonNodes, simple data binding uses Maps, Lists, Strings, Numbers, Booleans and nulls to represent the JSON structure. A Map/List/String/Number/Boolean hierarchy can be written out as JSON content.
JSON to Java
JSON to Java Code Example
Java to JSON
ObjectMapper om = new ObjectMapper(); Map root = ... om.writeValue(baos, root);