# jackson-databind
**Repository Path**: mirrors_cloudera/jackson-databind
## Basic Information
- **Project Name**: jackson-databind
- **Description**: General data-binding package for Jackson (2.x): works on streaming API (core) implementation(s)
- **Primary Language**: Unknown
- **License**: Not specified
- **Default Branch**: jackson-databind-2.6.5-cloudera
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2020-08-08
- **Last Updated**: 2025-12-20
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
# Cloudera Modifications
This release contains a backport of all the commits related to
CVE-2017-7525 and future related CVEs.
In essence, it's a backport of the following git hashes:
6ce32ffd18facac6abdbbf559c817b47fcb622c1
60d459cedcf079c6106ae7da2ac562bc32dcabe1
fd8dec2c7fab8b4b4bd60502a0f1d63ec23c24da
f4e8de59a4739273d5692d029f15986bb57dd273
3bfbb835e530055c1941ddf87fde0b08d08dcd38
e8f043d1aac9b82eee907e0f0c3abbdea723a935
ddfddfba6414adbecaff99684ef66eebd3a92e92
02ce588d77761bb03beca5748f3b2c918f205b2a
f031f27a31625d07922bdd090664c69544200a5d
e865a7a4464da63ded9f4b1a2328ad85c9ded78b
2235894210c75f624a3d0cd60bfb0434a20a18bf
978798382ceb72229e5036aa1442943933d6d171
bb45fb16709018842f858f1a6e1118676aaa34bd
755e3bc0cbea30de0102f6a88519a0c34d571bbd
038b471e2efde2e8f96b4e0be958d3e5a1ff1d05
c803a2658e45b8d1095d2504f943bd4ebaab18e9
6799f8f10cc78e9af6d443ed6982d00a13f2e7d2
e66c0a9d3c926ff1b63bf586c824ead1d02f2a3d
All of the backports are mostly a straight copy of the code related to
those hashes referenced. There is only one entry point to this
funtionality: _validateSubType() in BeanDeserializerFactory.java.
The '-cloudera.2' release includes
27b4defc270454dea6842bd9279f17387eceb737
7487cf7eb14be2f65a1eb108e8629c07ef45e0a1
87d29af25e82a249ea15858e2d4ecbf64091db44
72cd4025a229fb28ec133235003dd4616f70afaa
These commits address CVE-2018-19360, CVE-2018-19361, CVE-2018-19362,
CVE-2018-14718, CVE-2018-14719, CVE-2018-14720, and CVE-2018-14721
# Overview
This project contains the general-purpose data-binding functionality
and tree-model for [Jackson Data Processor](http://wiki.fasterxml.com/JacksonHome).
It builds on [core streaming parser/generator](../../../jackson-core) 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 for 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.
[](https://travis-ci.org/FasterXML/jackson-databind) [](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.core/jackson-databind)
-----
# Get it!
## Maven
Functionality of this package is contained in Java package `com.fasterxml.jackson.databind`, and can be used using following Maven dependency:
```xml
...
2.6.0
...
...
com.fasterxml.jackson.core
jackson-databind
${jackson.version}
...
```
Since package also depends on `jackson-core` and `jackson-annotations` packages, you will need to download these if not using Maven; and you may also want to add them as Maven dependency to ensure that compatible versions are used.
If so, also add:
```xml
...
com.fasterxml.jackson.core
jackson-annotations
${jackson.version}
com.fasterxml.jackson.core
jackson-core
${jackson.version}
...
```
but note that this is optional, and only necessary if there are conflicts between jackson core dependencies through transitive dependencies.
## Non-Maven
For non-Maven use cases, you download jars from [Central Maven repository](http://repo1.maven.org/maven2/com/fasterxml/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.
-----
# 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 `com.fasterxml.jackson.databind.ObjectMapper` instance, used for all data-binding, so let's construct one:
```java
ObjectMapper mapper = new ObjectMapper(); // create once, reuse
```
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