Chisle
The coding-agent plugin that bills 52% of a bare model across 20 live tasks. Terse persona + tool-output compressor + context diet.
翻訳待ち
General data-binding package for Jackson: works on streaming API (core) implementation(s)
翻訳待ち
開発ツールJava · LogosGitHub @FasterXML自分でインストール所有者未確認
Paste into Claude or ChatGPT for installation instructions suited to your environment.
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗This project contains the general-purpose data-binding functionality and tree-model for Jackson Data Processor. It builds on Streaming API (stream parser/generator) package, and uses Jackson Annotations for configuration. Project is licensed under Apache 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.
| Type | Status |
|---|---|
| Build (CI) | |
| Artifact | |
| OSS Sponsorship | |
| Javadocs | |
| Code coverage (3.x) | |
| OpenSSF Score |
Functionality of this package is contained in Java package tools.jackson.databind (for Jackson 3.x), and can be used using following Maven dependency:
<properties>
...
<!-- Use the latest version whenever possible. -->
<jackson.version>3.0.0</jackson.version>
...
</properties>
<dependencies>
...
<dependency>
<groupId>tools.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
...
</dependencies>
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 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.
For use cases that do not automatically resolve dependencies from Maven repositories, you can still download jars from Central Maven repository.
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.
Jackson-databind package baseline JDK requirements are as follows:
List is incomplete due to compatibility checker addition being done for Jackson 2.13.
for information on Android SDK versions to Android Release names see [https://en.wikipedia.org/wiki/Android_version_history]
More comprehensive documentation can be found from Jackson-docs repository; as well as from Wiki of this project. But here are brief introductionary tutorials, in recommended order of reading.
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:
// 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:
// 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:
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:
mapper.writeValue(new File("result.json"), myResultObject);
// or:
byte[] jsonBytes = mapper.writeValueAsBytes(myResultObject);
// or:
String jsonString = mapper.writeValueAsString(myResultObject);
So far so good?
Beyond dealing with simple Bean-style POJOs, you can also handle JDK Lists, Maps:
This is the beginning of the README. Read the rest at the original. Read the full README ↗