1# Overview 2 3This project contains core low-level incremental ("streaming") parser and generator abstractions used by 4[Jackson Data Processor](http://wiki.fasterxml.com/JacksonHome). 5It also includes the default implementation of handler types (parser, generator) that handle JSON format. 6The core abstractions are not JSON specific, although naming does contain 'JSON' in many places, due to historical reasons. Only packages that specifically contain word 'json' are JSON-specific. 7 8This package is the base on which [Jackson data-binding](https://github.com/FasterXML/jackson-databind) package builds on. 9It is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). 10For additional/alternative licensing questions, please contact `info@fasterxml.com`: affordable commercial licenses available for use cases like Android app development. 11 12Alternate data format implementations (like 13[Smile (binary JSON)](https://github.com/FasterXML/jackson-dataformat-smile), 14[XML](https://github.com/FasterXML/jackson-dataformat-xml), 15[CSV](https://github.com/FasterXML/jackson-dataformat-csv)) 16and [CBOR](https://github.com/FasterXML/jackson-dataformat-cbor) 17also build on this base package, implementing the core interfaces, 18making it possible to use standard [data-binding package](https://github.com/FasterXML/jackson-databind) regardless of underlying data format. 19 20Project contains versions 2.0 and above: source code for earlier (1.x) versions is available from [Codehaus](http://jackson.codehaus.org) SVN repository. 21 22[![Build Status](https://travis-ci.org/FasterXML/jackson-core.svg?branch=master)](https://travis-ci.org/FasterXML/jackson-core) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.core/jackson-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.core/jackson-core) 23[![Javadoc](https://javadoc.io/badge/com.fasterxml.jackson.core/jackson-core.svg)](http://www.javadoc.io/doc/com.fasterxml.jackson.core/jackson-core) 24[![Coverage Status](https://coveralls.io/repos/github/FasterXML/jackson-core/badge.svg?branch=master)](https://coveralls.io/github/FasterXML/jackson-core?branch=master) 25 26# Get it! 27 28## Maven 29 30Functionality of this package is contained in 31Java package `com.fasterxml.jackson.core`. 32 33To use the package, you need to use following Maven dependency: 34 35```xml 36<dependency> 37 <groupId>com.fasterxml.jackson.core</groupId> 38 <artifactId>jackson-core</artifactId> 39 <version>${jackson-core-version}</version> 40</dependency> 41``` 42 43or download jars from Maven repository or links on [Wiki](../../wiki). 44Core jar is a functional OSGi bundle, with proper import/export declarations. 45 46Package has no external dependencies, except for testing (which uses `JUnit`). 47 48## Non-Maven 49 50For non-Maven use cases, you download jars from [Central Maven repository](http://repo1.maven.org/maven2/com/fasterxml/jackson/core/jackson-core/) or [Wiki](../../wiki). 51 52Core jar is also a functional OSGi bundle, with proper import/export declarations, so it can be use on OSGi container as is. 53 54----- 55# Use it! 56 57## General 58 59Usage typically starts with creation of a reusable (and thread-safe, once configured) `JsonFactory` instance: 60 61```java 62JsonFactory factory = new JsonFactory(); 63// configure, if necessary: 64factory.enable(JsonParser.Feature.ALLOW_COMMENTS); 65``` 66 67Alternatively, you have a `ObjectMapper` (from [Jackson Databind package](https://github.com/FasterXML/jackson-databind)) handy; if so, you can do: 68 69```java 70JsonFactory factory = objectMapper.getFactory(); 71``` 72 73## Usage, simple reading 74 75All reading is by using `JsonParser` (or its sub-classes, in case of data formats other than JSON), 76instance of which is constructed by `JsonFactory`. 77 78An example can be found from [Reading and Writing Event Streams](http://www.cowtowncoder.com/blog/archives/2009/01/entry_132.html) 79 80## Usage, simple writing 81 82All writing is by using `JsonGenerator` (or its sub-classes, in case of data formats other than JSON), 83instance of which is constructed by `JsonFactory`: 84 85An example can be found from [Reading and Writing Event Streams](http://www.cowtowncoder.com/blog/archives/2009/01/entry_132.html) 86 87----- 88 89# Further reading 90 91## Differences from Jackson 1.x 92 93Project contains versions 2.0 and above: source code for earlier (1.x) versions is available from [Codehaus](http://jackson.codehaus.org) SVN repository 94 95Note that the main differences compared to 1.0 core jar are: 96 97* Maven build instead of Ant 98* Annotations carved out to a separate package (that this package depends on) 99* Java package is now `com.fasterxml.jackson.core` (instead of `org.codehaus.jackson`) 100 101## Links 102 103* Project [Wiki](../../wiki) has JavaDocs and links to downloadable artifacts 104* [Jackson Github Hub](https://github.com/FasterXML/jackson) has links to all official Jackson components 105* [Jackson Github Doc](https://github.com/FasterXML/jackson-docs) is the hub for official Jackson documentation 106 107