Skip to content

Commit 9a5c653

Browse files
committed
Backport cbor/README.md updates
1 parent 5dba277 commit 9a5c653

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

cbor/README.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,28 @@
11
## Overview
22

3-
[Jackson](/FasterXML/jackson) (Java) data format module that supports reading and writing
3+
[Jackson](../../../../jackson) (Java) data format module that supports reading and writing
44
[CBOR](https://www.rfc-editor.org/info/rfc7049)
55
("Concise Binary Object Representation") encoded data.
66
Module extends standard Jackson streaming API (`JsonFactory`, `JsonParser`, `JsonGenerator`), and as such works seamlessly with all the higher level data abstractions (data binding, tree model, and pluggable extensions).
77

8+
It also supports:
9+
10+
* CBOR Sequences ([RFC-8742](https://www.rfc-editor.org/rfc/rfc8742.html)) (root-level value sequences)
11+
* uses standard Jackson databind `MappingIterator` and `SequenceWriter` abstractions
12+
813
## Status
914

1015
This module is considered stable and production quality (since 2.4). Similar to JSON- and other JSON-like
1116
backends, it implementsfull support for all levels (streaming, data-binding, tree model).
1217

1318
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/)
14-
[![Javadoc](https://javadoc-emblem.rhcloud.com/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor/badge.svg)](http://www.javadoc.io/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor)
19+
[![Javadoc](https://javadoc.io/badge/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor.svg)](http://www.javadoc.io/doc/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor)
1520

1621
### Limitations
1722

1823
Minor limitations exist with respect to advanced type-handling of `CBOR` format:
1924

20-
* While tags are written for some types (`BigDecimal`, `BigInteger`), they are not handling on parsing
25+
* While tags are written for some types (`BigDecimal`, `BigInteger`), they are not handled on parsing
2126

2227
# Maven dependency
2328

@@ -27,19 +32,19 @@ To use this extension on Maven-based projects, use following dependency:
2732
<dependency>
2833
<groupId>com.fasterxml.jackson.dataformat</groupId>
2934
<artifactId>jackson-dataformat-cbor</artifactId>
30-
<version>2.7.4</version>
35+
<version>2.12.2</version>
3136
</dependency>
3237
```
3338

3439
(or whatever version is most up-to-date at the moment)
3540

3641
## Usage
3742

38-
Basic usage is by using `CborFactory` in places where you would usually use `JsonFactory`:
43+
Basic usage is by using `CBORFactory` in places where you would usually use `JsonFactory`
44+
(or `CBORFactory` instead `JsonMapper`/`ObjectMapper`)
3945

4046
```java
41-
CBORFactory f = new CBORFactory();
42-
ObjectMapper mapper = new ObjectMapper(f);
47+
ObjectMapper mapper = new CBORMapper();
4348
// and then read/write data as usual
4449
SomeType value = ...;
4550
byte[] cborData = mapper.writeValueAsBytes(value);
@@ -50,6 +55,7 @@ Implementation allows use of any of 3 main operating modes:
5055

5156
* Streaming API (`CBORParser` and `CBORGenerator`)
5257
* Databinding (via `ObjectMapper` / `ObjectReader` / `ObjectWriter`)
58+
* Use subtype `CBORMapper`
5359
* Tree Model (using `TreeNode`, or its concrete subtype, `JsonNode` -- not JSON-specific despite the name)
5460

5561
and all the usual data-binding use cases exactly like when using `JSON` or `Smile` (2 canonical 100% supported Jackson data formats).

0 commit comments

Comments
 (0)