Functionality of this package is contained in Java package com.fasterxml.jackson.core
.
To use databinding, you need to use following Maven dependency:
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-core</artifactId> <version>2.0.0</version> </dependency>
or download jars from Maven repository or Download page. Core jar is a functional OSGi bundle, with proper import/export declarations.
Package has no external dependencies, except for testing (which uses JUnit
).
For non-Maven use cases, you download jars from Central Maven repository or Download page.
Core jar is also a functional OSGi bundle, with proper import/export declarations, so it can be use on OSGi container as is.
Usage typically starts with creation of a reusable (and thread-safe, once configured) JsonFactory
instance:
JsonFactory factory = new JsonFactory(); // configure, if necessary: factory.enable(JsonParser.Feature.ALLOW_COMMENTS);
Alternatively, you have a ObjectMapper
(from Jackson Databind package) handy; if so, you can do:
JsonFactory factory = objectMapper.getJsonFactory();
All reading is by using JsonParser
(or its sub-classes, in case of data formats other than JSON), instance of which is constructed by JsonFactory
:
(TO BE WRITTEN)
All writing is by using JsonGenerator
(or its sub-classes, in case of data formats other than JSON), instance of which is constructed by JsonFactory
:
(TO BE WRITTEN)
Project-specific documentation:
Related: