# jackson-databind
**Repository Path**: ieat/jackson-databind
## Basic Information
- **Project Name**: jackson-databind
- **Description**: No description available
- **Primary Language**: Java
- **License**: Apache-2.0
- **Default Branch**: 3.x
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-12-22
- **Last Updated**: 2025-12-22
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Overview
This project contains the general-purpose data-binding functionality
and tree-model for [Jackson Data Processor](../../../jackson).
It builds on [Streaming API](../../../jackson-core) (stream parser/generator) package,
and uses [Jackson Annotations](../../../jackson-annotations) for configuration.
Project is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
While the original use case for Jackson was JSON data-binding, it can now be used to read content
encoded in other data formats as well, as long as parser and generator implementations exist.
Naming of classes uses word 'JSON' in many places even though there is no actual hard dependency to JSON format.
## Status
| Type | Status |
| ---- | ------ |
| Build (CI) | [](https://github.com/FasterXML/jackson-databind/actions/workflows/main.yml) |
| Artifact |  |
| OSS Sponsorship | [](https://tidelift.com/subscription/pkg/maven-com-fasterxml-jackson-core-jackson-databind?utm_source=maven-tools-jackson-core-jackson-databind&utm_medium=referral&utm_campaign=readme) |
| Javadocs | [](http://www.javadoc.io/doc/tools.jackson.core/jackson-databind) |
| Code coverage (3.0) | [](https://codecov.io/github/FasterXML/jackson-databind?branch=3.x) |
| OpenSSF Score | [](https://securityscorecards.dev/viewer/?uri=github.com/FasterXML/jackson-databind) |
# Get it!
## Maven
Functionality of this package is contained in Java package `tools.jackson.databind` (for Jackson 3.x), and can be used using following Maven dependency:
```xml
...
3.0.0
...
...
tools.jackson.core
jackson-databind
${jackson.version}
...
```
Package also depends on `jackson-core` and `jackson-annotations` packages, but when using build tools
like Maven or Gradle, dependencies are automatically included.
You may, however, want to use [jackson-bom](../../../jackson-bom) to ensure compatible versions
of dependencies.
If not using build tool that can handle dependencies using project's `pom.xml`, you will need to download
and include these 2 jars explicitly.
## Non-Maven dependency resolution
For use cases that do not automatically resolve dependencies from Maven repositories, you can still
download jars from [Central Maven repository](https://repo1.maven.org/maven2/tools/jackson/core/jackson-databind/).
Databind jar is also a functional OSGi bundle, with proper import/export declarations, so it can be use on OSGi container as is.
Jackson 2.10 and above include `module-info.class` definitions so the jar is also a proper Java Module (JPMS).
Jackson 2.12 and above include additional Gradle 6 Module Metadata for version alignment with Gradle.
-----
## Compatibility
### JDK
Jackson-databind package baseline JDK requirements are as follows:
* Versions 2.x require JDK 8
* Versions 3.x require JDK 17
### Android
List is incomplete due to compatibility checker addition being done for Jackson 2.13.
* 2.14 - 2.19: Android SDK 26+
* 3.0: Android SDK 34+
for information on Android SDK versions to Android Release names see [https://en.wikipedia.org/wiki/Android_version_history]
-----
# Use It!
More comprehensive documentation can be found from [Jackson-docs](../../../jackson-docs) repository; as well as from [Wiki](../../wiki) of this project.
But here are brief introductionary tutorials, in recommended order of reading.
## 1 minute tutorial: POJOs to JSON and back
The most common usage is to take piece of JSON, and construct a Plain Old Java Object ("POJO") out of it. So let's start there. With simple 2-property POJO like this:
```java
// Note: can use getters/setters as well; here we just use public fields directly:
public class MyValue {
public String name;
public int age;
// NOTE: if using getters/setters, can keep fields `protected` or `private`
}
```
we will need a `tools.jackson.databind.ObjectMapper` instance, used for all data-binding, so let's construct one:
```java
// With default settings can use
ObjectMapper mapper = new ObjectMapper(); // create once, reuse
// But if configuration needed, use builder pattern:
ObjectMapper mapper = JsonMapper.builder()
// configuration
.build();
```
The default instance is fine for our use -- we will learn later on how to configure mapper instance if necessary. Usage is simple:
```java
MyValue value = mapper.readValue(new File("data.json"), MyValue.class);
// or:
value = mapper.readValue(new URL("http://some.com/api/entry.json"), MyValue.class);
// or:
value = mapper.readValue("{\"name\":\"Bob\", \"age\":13}", MyValue.class);
```
And if we want to write JSON, we do the reverse:
```java
mapper.writeValue(new File("result.json"), myResultObject);
// or:
byte[] jsonBytes = mapper.writeValueAsBytes(myResultObject);
// or:
String jsonString = mapper.writeValueAsString(myResultObject);
```
So far so good?
## 3 minute tutorial: Generic collections, Tree Model
Beyond dealing with simple Bean-style POJOs, you can also handle JDK `List`s, `Map`s:
```java
Map scoreByName = mapper.readValue(jsonSource, Map.class);
List names = mapper.readValue(jsonSource, List.class);
// and can obviously write out as well
mapper.writeValue(new File("names.json"), names);
```
as long as JSON structure matches, and types are simple.
If you have POJO values, you need to indicate actual type (note: this is NOT needed for POJO properties with `List` etc types):
```java
Map results = mapper.readValue(jsonSource,
new TypeReference