Champollion exposes two distinct Jakarta APIs: JSON-P (Processing) which manipulates raw JSON as an event stream or value tree, and JSON-B (Binding) which automatically maps between JSON and POJOs. This page lays out the vocabulary of each.
JSON-P 2.1 — JSON Processing
Low-level API, JSON-structure oriented. Covers spec https://jakarta.ee/specifications/jsonp/2.1/.
Parser and Generator (streaming)
|
Pull event-based reader: |
|
Push fluent writer: |
|
Pre-configured factories (buffer pool, pretty-printing, encoding). Reusable, thread-safe. |
Object model (DOM)
|
Sealed interface — root of the hierarchy. Subtypes: |
|
Immutable |
|
Immutable |
|
Mutable builders; |
|
Whole-document read / write of a |
Patch / Pointer / Merge Patch
|
Addresses a value inside a document: |
|
Sequence of atomic operations ( |
|
Tree-merge differential patch. |
JSON-B 3.0 — JSON Binding
High-level API, Java-object oriented. Covers spec https://jakarta.ee/specifications/jsonb/3.0/.
|
Main entry point. |
|
Fluent. |
|
Standard property bag: |
|
Bidirectional conversion between a Java type and a native JSON type (typically |
|
Low-level customization: you drive |
|
Plan resolved once per class: ordered list of |
|
Contract of an APT-generated static binding. Implemented by |
Essential difference: JSON-P vs JSON-B
| Criterion | JSON-P | JSON-B |
|---|---|---|
Level |
Low — handles events or a JSON DOM |
High — handles Java objects |
Typical use |
Streaming, large documents, patch / merge |
REST DTOs, configuration, CRUD payloads |
Allocation |
Minimal in streaming (zero DOM) |
A full object graph per call |
Customization |
None — pure structure |
Annotations ( |
Performance target |
Parsson / Jackson streaming |
Yasson / Jackson databind |
JSON-B builds on JSON-P: Jsonb.toJson(obj) ultimately pushes into a JsonGenerator. The binding layer composes on top of the processing layer — never the other way round.
Champollion-specific vocabulary
Runtime mode |
JSON-B binding by |
Static mode (or "codegen") |
JSON-B binding generated at compile time by |
Differential testing |
Automated suite: for each tested type, verify |
|
Champollion-specific annotation marking a type for binding generation. Optional — the APT also scans types annotated with standard annotations ( |
|
ServiceLoader SPI exposing a generated static binding. The runtime queries this SPI first, then falls back to introspection if absent. |