This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch docs
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/docs by this push:
new 481ad7276e docs: add MarshallUtils and JsonMap/JsonList toX() release
notes to 9.2.1
481ad7276e is described below
commit 481ad7276ee7bd36def8ec1b3541a7bb893eec12
Author: James Bognar <[email protected]>
AuthorDate: Sun May 3 08:51:37 2026 -0400
docs: add MarshallUtils and JsonMap/JsonList toX() release notes to 9.2.1
Co-authored-by: Cursor <[email protected]>
---
pages/release-notes/9.2.1.md | 105 ++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 104 insertions(+), 1 deletion(-)
diff --git a/pages/release-notes/9.2.1.md b/pages/release-notes/9.2.1.md
index e8b399ead9..761cc51524 100644
--- a/pages/release-notes/9.2.1.md
+++ b/pages/release-notes/9.2.1.md
@@ -6,7 +6,7 @@ title: "Release 9.2.1"
**Date:** TBD
-Juneau 9.2.1 is a minor release with native TOML and YAML support, BSON
(Binary JSON) support for MongoDB-interoperable binary serialization, CBOR
(Concise Binary Object Representation) per RFC 8949 for IoT and constrained
environments, full CSV serializer/parser support, JCS (JSON Canonicalization
Scheme) per RFC 8785 for deterministic hashing and signing, RDF/THRIFT and
RDF/PROTO binary format support, native serialization support for
lazy-evaluated sequence types, large-dataset stream [...]
+Juneau 9.2.1 is a minor release with native TOML and YAML support, BSON
(Binary JSON) support for MongoDB-interoperable binary serialization, CBOR
(Concise Binary Object Representation) per RFC 8949 for IoT and constrained
environments, full CSV serializer/parser support, JCS (JSON Canonicalization
Scheme) per RFC 8785 for deterministic hashing and signing, RDF/THRIFT and
RDF/PROTO binary format support, native serialization support for
lazy-evaluated sequence types, large-dataset stream [...]
### juneau-marshall
@@ -789,6 +789,109 @@ Several session classes were overriding accessor methods
to return `ctx.isAddBea
Similarly, `ParserSession.isTrimStrings()` now returns the session-level field
(initialized from the context) instead of delegating to `ctx.isTrimStrings()`.
And `UonSerializerSession.getQuoteChar()` no longer bypasses the
`WriterSerializerSession` session field.
+#### `MarshallUtils`: Static Serialization and Parsing Helpers
+
+A new utility class, `org.apache.juneau.marshaller.MarshallUtils`, provides a
single point of static
+convenience methods for every serialization format supported by Juneau. All
methods are designed to
+be used with a `static import` so call sites need no explicit marshaller
reference.
+
+```java
+import static org.apache.juneau.marshaller.MarshallUtils.*;
+
+// Serialize to any text format — returns String
+String a = json(myBean);
+String b = json5(myBean);
+String c = xml(myBean);
+String d = html(myBean);
+String e = yaml(myBean);
+String f = csv(myBean);
+String g = toml(myBean);
+String h = hocon(myBean);
+
+// Serialize to binary formats — returns byte[]
+byte[] m = msgPack(myBean);
+byte[] n = cbor(myBean);
+byte[] o = bson(myBean);
+byte[] p = parquet(myBean);
+
+// Parse — same method names, overloaded by input type
+MyBean b1 = json(jsonString, MyBean.class);
+MyBean b2 = xml(xmlString, MyBean.class);
+MyBean b3 = msgPack(bytes, MyBean.class);
+List<MyBean> beans = parquet(bytes, MyBean.class);
+```
+
+##### Supported Formats
+
+| Method | Format | Output |
+|---|---|---|
+| `json(o)` | Standard JSON (RFC 8259) | `String` |
+| `json5(o)` | JSON5 | `String` |
+| `jsonl(o)` | JSON Lines (NDJSON) | `String` |
+| `jcs(o)` | Canonical JSON (RFC 8785) | `String` |
+| `hjson(o)` | HJSON | `String` |
+| `xml(o)` | XML | `String` |
+| `html(o)` | HTML | `String` |
+| `uon(o)` | URL-Encoded Object Notation | `String` |
+| `urlEncoding(o)` | URL Encoding | `String` |
+| `yaml(o)` | YAML | `String` |
+| `csv(o)` | CSV | `String` |
+| `openApi(o)` | OpenAPI | `String` |
+| `plainText(o)` | Plain text | `String` |
+| `markdown(o)` | Markdown (fragment) | `String` |
+| `markdownDoc(o)` | Markdown (document) | `String` |
+| `ini(o)` | INI / properties | `String` |
+| `toml(o)` | TOML | `String` |
+| `hocon(o)` | HOCON | `String` |
+| `proto(o)` | Protobuf Text Format | `String` |
+| `msgPack(o)` | MessagePack | `byte[]` |
+| `cbor(o)` | CBOR (RFC 8949) | `byte[]` |
+| `bson(o)` | BSON | `byte[]` |
+| `parquet(o)` | Apache Parquet | `byte[]` |
+
+Every text format also has a corresponding parse overload (same method name,
`String` + `Class<T>` arguments).
+Binary formats have a `byte[]` + `Class<T>` parse overload. Parse methods
wrap checked exceptions in unchecked
+runtime exceptions so they can be used in lambdas and streams without
`try/catch`.
+
+#### `JsonMap` and `JsonList`: New `toX()` Serialization Methods
+
+The serialization helper methods on `JsonMap` and `JsonList` have been renamed
from the `asX()` convention
+to the `toX()` convention and extended with additional JSON-flavor methods.
+
+##### `JsonMap`
+
+| New Method | Description |
+|---|---|
+| `toJson()` | Serializes to standard JSON (double-quoted keys/strings). |
+| `toJson5()` | Serializes to JSON5 — unquoted keys, single-quoted strings.
Synonym for `toString()`. |
+| `toJsonl()` | Serializes to JSON Lines. |
+| `toJcs()` | Serializes to Canonical JSON (RFC 8785). |
+| `toHjson()` | Serializes to HJSON. |
+| `toReadableJson5()` | Serializes to indented, human-readable JSON5. |
+| `toString(WriterSerializer)` | Serializes using any `WriterSerializer`. |
+
+##### `JsonList`
+
+| New Method | Description |
+|---|---|
+| `toJson()` | Serializes to standard JSON. |
+| `toJson5()` | Serializes to JSON5. Synonym for `toString()`. |
+| `toJsonl()` | Serializes to JSON Lines. |
+| `toJcs()` | Serializes to Canonical JSON (RFC 8785). |
+| `toHjson()` | Serializes to HJSON. |
+| `toString(WriterSerializer)` | Serializes using any `WriterSerializer`. |
+
+##### Removed Methods
+
+The following `asX()` methods have been removed in favor of their `toX()`
equivalents:
+
+| Removed | Replacement |
+|---|---|
+| `asJson()` | `toJson5()` or `toString()` |
+| `asString()` | `toJson5()` |
+| `asReadableString()` *(JsonMap only)* | `toReadableJson5()` |
+| `asString(WriterSerializer)` | `toString(WriterSerializer)` |
+
### juneau-marshall-rdf
#### Upgraded Apache Jena to 5.6.0