You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@juneau.apache.org by ja...@apache.org on 2026/06/17 11:55:30 UTC
(juneau) branch master updated: refactor(marshall): rename text-format Proto codec to Prototext (binary stays Protobuf); de-flake PetstoreJetty_Test request timeouts
This is an automated email from the ASF dual-hosted git repository.
jamesbognar pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/juneau.git
The following commit(s) were added to refs/heads/master by this push:
new 2487121feb refactor(marshall): rename text-format Proto codec to Prototext (binary stays Protobuf); de-flake PetstoreJetty_Test request timeouts
2487121feb is described below
commit 2487121feb3ee201c6a27e9791481db0c13b64a1
Author: James Bognar <ja...@apache.org>
AuthorDate: Wed Jun 17 07:55:24 2026 -0400
refactor(marshall): rename text-format Proto codec to Prototext (binary stays Protobuf); de-flake PetstoreJetty_Test request timeouts
---
RELEASE-NOTES.txt | 8 +-
.../MarshallingContext_ValidateSchema_Test.java | 4 +-
.../BigNumberFormat_BigDecimal_RoundTrip_Test.java | 8 +-
.../BigNumberFormat_BigInteger_RoundTrip_Test.java | 8 +-
.../transforms/BinaryFormat_RoundTrip_Test.java | 2 +-
.../transforms/BooleanFormat_RoundTrip_Test.java | 2 +-
.../FloatFormat_Double_RoundTrip_Test.java | 8 +-
.../FloatFormat_Float_RoundTrip_Test.java | 4 +-
.../transforms/UuidFormat_RoundTrip_Test.java | 2 +-
.../apache/juneau/marshall/BigNumberFormat.java | 2 +-
.../org/apache/juneau/marshall/BinaryFormat.java | 2 +-
.../org/apache/juneau/marshall/BooleanFormat.java | 2 +-
.../org/apache/juneau/marshall/ClassFormat.java | 2 +-
.../java/org/apache/juneau/marshall/Context.java | 4 +-
.../org/apache/juneau/marshall/CurrencyFormat.java | 2 +-
.../org/apache/juneau/marshall/FloatFormat.java | 2 +-
.../marshall/MarshalledPropertyPostProcessor.java | 2 +-
.../apache/juneau/marshall/MarshallingContext.java | 4 +-
.../org/apache/juneau/marshall/UuidFormat.java | 2 +-
.../juneau/marshall/marshaller/MarshallUtils.java | 18 +-
.../juneau/marshall/marshaller/Protobuf.java | 2 +-
.../marshaller/{Proto.java => Prototext.java} | 20 +-
.../apache/juneau/marshall/protobuf/Protobuf.java | 2 +-
.../marshall/protobuf/ProtobufSerializer.java | 2 +-
.../juneau/marshall/protobuf/package-info.java | 2 +-
.../{proto/Proto.java => prototext/Prototext.java} | 6 +-
.../PrototextAnnotation.java} | 22 +--
.../PrototextApply.java} | 20 +-
.../PrototextApplyAnnotation.java} | 46 ++---
.../PrototextBeanPropertyMeta.java} | 18 +-
.../PrototextClassMeta.java} | 10 +-
.../PrototextConfig.java} | 8 +-
.../PrototextConfigAnnotation.java} | 26 +--
.../PrototextMetaProvider.java} | 10 +-
.../PrototextParser.java} | 52 ++---
.../PrototextParserSession.java} | 78 ++++----
.../PrototextSerializer.java} | 56 +++---
.../PrototextSerializerSession.java} | 54 +++---
.../PrototextToken.java} | 6 +-
.../PrototextTokenizer.java} | 72 +++----
.../PrototextWriter.java} | 76 ++++----
.../{proto => prototext}/package-info.java | 10 +-
.../serializer/OutputStreamSerializerSession.java | 2 +-
.../marshall/NullInclusionAndCoercion_Test.java | 4 +-
.../PrototextAnnotation_Test.java} | 72 +++----
.../PrototextEdgeCases_Test.java} | 40 ++--
.../PrototextMediaType_Test.java} | 14 +-
.../PrototextParser_Test.java} | 46 ++---
.../PrototextRoundTrip_Test.java} | 68 +++----
.../PrototextSerializerSession_Test.java} | 114 +++++------
.../PrototextSerializer_Test.java} | 42 ++--
.../PrototextTokenizer_Test.java} | 214 ++++++++++-----------
.../stream/FormatStreamingCapability_Test.java | 6 +-
.../juneau/marshall/stream/RecordStream_Test.java | 10 +-
.../BigNumberFormat_BigDecimal_RoundTrip_Test.java | 16 +-
.../BigNumberFormat_BigInteger_RoundTrip_Test.java | 16 +-
.../transforms/BinaryFormat_RoundTrip_Test.java | 10 +-
.../transforms/BooleanFormat_RoundTrip_Test.java | 10 +-
.../transforms/CalendarFormat_RoundTrip_Test.java | 8 +-
.../transforms/ClassFormat_RoundTrip_Test.java | 8 +-
.../transforms/CurrencyFormat_RoundTrip_Test.java | 8 +-
.../transforms/DateFormat_RoundTrip_Test.java | 8 +-
.../transforms/DurationFormat_RoundTrip_Test.java | 8 +-
.../transforms/EnumFormat_RoundTrip_Test.java | 8 +-
.../FloatFormat_Double_RoundTrip_Test.java | 16 +-
.../FloatFormat_Float_RoundTrip_Test.java | 12 +-
.../transforms/LocaleFormat_RoundTrip_Test.java | 8 +-
.../transforms/PeriodFormat_RoundTrip_Test.java | 8 +-
.../TemporalFormat_Instant_RoundTrip_Test.java | 8 +-
...emporalFormat_LocalDateTime_RoundTrip_Test.java | 8 +-
.../TemporalFormat_LocalDate_RoundTrip_Test.java | 8 +-
.../TemporalFormat_LocalTime_RoundTrip_Test.java | 8 +-
.../TemporalFormat_MonthDay_RoundTrip_Test.java | 8 +-
...mporalFormat_OffsetDateTime_RoundTrip_Test.java | 8 +-
.../TemporalFormat_OffsetTime_RoundTrip_Test.java | 8 +-
.../TemporalFormat_YearMonth_RoundTrip_Test.java | 8 +-
.../TemporalFormat_Year_RoundTrip_Test.java | 8 +-
...emporalFormat_ZonedDateTime_RoundTrip_Test.java | 8 +-
.../transforms/TimeZoneFormat_RoundTrip_Test.java | 8 +-
.../transforms/UuidFormat_RoundTrip_Test.java | 10 +-
.../{Proto_Test.java => Prototext_Test.java} | 30 +--
.../juneau/a/rttests/RoundTripDateTime_Test.java | 8 +-
.../juneau/petstore/jetty/PetstoreJetty_Test.java | 8 +-
.../juneau/rest/client/classic/RestClient.java | 6 +-
.../org/apache/juneau/http/header/ContentType.java | 2 +-
...cProtoConfig.java => BasicPrototextConfig.java} | 12 +-
.../rest/server/config/BasicUniversalConfig.java | 6 +-
87 files changed, 816 insertions(+), 816 deletions(-)
diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt
index f549ce67c2..983b40d395 100644
--- a/RELEASE-NOTES.txt
+++ b/RELEASE-NOTES.txt
@@ -92,14 +92,14 @@ Release Notes - Juneau - Version 9.2.1 - YYYY-MM-DD
** New Features - Protobuf Text Format Support
- * New ProtoSerializer and ProtoParser for the human-readable Protobuf Text Format (NOT binary wire format).
+ * New PrototextSerializer and PrototextParser for the human-readable Protobuf Text Format (NOT binary wire format).
* Media types: produces text/protobuf, accepts text/protobuf and text/x-protobuf.
* No .proto schema files required—Java bean metadata provides the type information.
* Supports beans, maps, collections, scalars, repeated fields, and nested messages.
* Date/time and Duration types serialized as ISO 8601 strings.
- * New classes: ProtoSerializer, ProtoParser, Proto (marshaller), ProtoWriter, ProtoTokenizer.
- * New annotations: @Proto (comment), @ProtoConfig (useListSyntaxForBeans, useColonForMessages).
- * BasicProtoConfig REST interface for Proto-only resources; Proto included in BasicUniversalConfig.
+ * New classes: PrototextSerializer, PrototextParser, Prototext (marshaller), PrototextWriter, PrototextTokenizer.
+ * New annotations: @Prototext (comment), @PrototextConfig (useListSyntaxForBeans, useColonForMessages).
+ * BasicPrototextConfig REST interface for Prototext-only resources; Prototext included in BasicUniversalConfig.
** New Features - CSV Marshalling Parity with JSON
diff --git a/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/MarshallingContext_ValidateSchema_Test.java b/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/MarshallingContext_ValidateSchema_Test.java
index 4f31c3c3b9..21258abe8b 100644
--- a/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/MarshallingContext_ValidateSchema_Test.java
+++ b/juneau-bean/juneau-bean-jsonschema/src/test/java/org/apache/juneau/MarshallingContext_ValidateSchema_Test.java
@@ -237,8 +237,8 @@ class MarshallingContext_ValidateSchema_Test extends TestBase {
assertNotNull(org.apache.juneau.marshall.hjson.HjsonParser.create().validateSchema(true).build());
assertNotNull(org.apache.juneau.marshall.toml.TomlSerializer.create().validateSchema().build());
assertNotNull(org.apache.juneau.marshall.toml.TomlParser.create().validateSchema().build());
- assertNotNull(org.apache.juneau.marshall.proto.ProtoSerializer.create().validateSchema().build());
- assertNotNull(org.apache.juneau.marshall.proto.ProtoParser.create().validateSchema().build());
+ assertNotNull(org.apache.juneau.marshall.prototext.PrototextSerializer.create().validateSchema().build());
+ assertNotNull(org.apache.juneau.marshall.prototext.PrototextParser.create().validateSchema().build());
assertNotNull(org.apache.juneau.marshall.cbor.CborSerializer.create().validateSchema().build());
assertNotNull(org.apache.juneau.marshall.cbor.CborParser.create().validateSchema().build());
assertNotNull(org.apache.juneau.marshall.bson.BsonSerializer.create().validateSchema().build());
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
index 8d55e38c02..07483db889 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
@@ -52,7 +52,7 @@ import org.junit.jupiter.params.provider.*;
* {@link BigNumberFormat#format(BigDecimal, BigNumberFormat) BigNumberFormat.format(BigDecimal,…)} contract,
* any non-zero-scale {@link BigDecimal} (anything with a fractional part) is forced to {@link BigNumberFormat#STRING}
* regardless of magnitude. Zero-scale {@link BigDecimal} values use the integer JS-safe bound. Binary serializers
- * (MsgPack / CBOR / Proto / BSON / Parquet) bypass the format dispatch and receive the native {@link BigDecimal};
+ * (MsgPack / CBOR / Prototext / BSON / Parquet) bypass the format dispatch and receive the native {@link BigDecimal};
* they downcast to {@code double} or equivalent and may lose precision past 64-bit float capacity. The matrix
* below stays inside double-precision-safe scales / magnitudes so binary round-trips remain lossless.
*/
@@ -178,7 +178,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
* fractional {@link BigDecimal} values to integer on the wire.
*
* <p>
- * Toml and Proto serializer sessions classify any non-{@link Float} / non-{@link Double} {@link Number}
+ * Toml and Prototext serializer sessions classify any non-{@link Float} / non-{@link Double} {@link Number}
* via {@code w.integerValue(((Number)value).longValue())} in their {@code writeValue} dispatch, which
* truncates the fractional part. Under {@link BigNumberFormat#STRING} / {@link BigNumberFormat#AUTO}
* the swap returns a {@link String} for the bean-property path, so the {@code Number} branch isn't
@@ -193,7 +193,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
*/
private static boolean truncatesFractionalBigDecimal(RoundTrip_Tester t, BigNumberFormat fmt, boolean isTopLevel) {
var s = t.getSerializer();
- var affected = s instanceof org.apache.juneau.marshall.toml.TomlSerializer || s instanceof org.apache.juneau.marshall.proto.ProtoSerializer;
+ var affected = s instanceof org.apache.juneau.marshall.toml.TomlSerializer || s instanceof org.apache.juneau.marshall.prototext.PrototextSerializer;
if (!affected)
return false;
if (isTopLevel)
@@ -342,7 +342,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
// standalone BigDecimal value — they assert that the serializer accepts it without throwing.
if (t.isValidationOnly())
return;
- // Top-level raw-value dispatch on Toml/Proto truncates fractional BigDecimal regardless of format
+ // Top-level raw-value dispatch on Toml/Prototext truncates fractional BigDecimal regardless of format
// (the swap install path only applies to bean-property metadata, not standalone-value dispatch).
if (truncatesFractionalBigDecimal(t, fmt, true))
return;
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
index a6d3173166..871636a780 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
@@ -51,7 +51,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link BigNumberFormat} is structurally lossless for {@link BigInteger} on text serializers — every constant
* preserves the full integer value (the choice is just bare-numeric vs quoted-string vs JS-safe hybrid).
- * Binary serializers (MsgPack / CBOR / Proto / BSON) bypass the format dispatch and receive the native
+ * Binary serializers (MsgPack / CBOR / Prototext / BSON) bypass the format dispatch and receive the native
* {@link BigInteger}; the binary format then decides how to encode it natively. Values beyond a 64-bit
* signed integer ({@code ±2^63 − 1}) may lose precision or fail in formats that lack a wide-integer wire type.
*/
@@ -225,10 +225,10 @@ class BigNumberFormat_BigInteger_RoundTrip_Test extends TestBase {
// Bean with large BigInteger — JS-unsafe-but-long-safe stress (AUTO dispatch + NUMBER/STRING boundary)
//
// <p>
- // Values are pinned within signed 64-bit range so binary serializers (MsgPack / CBOR / BSON / Proto)
+ // Values are pinned within signed 64-bit range so binary serializers (MsgPack / CBOR / BSON / Prototext)
// that bypass {@code BigNumberFormat} dispatch and emit native int64 round-trip cleanly. Values beyond
// {@code Long.MAX_VALUE} are out-of-matrix scope by design: per the {@link BigNumberFormat} class-level
- // "Binary serializers" note, MsgPack / CBOR / Proto / BSON downcast big integers to their widest native
+ // "Binary serializers" note, MsgPack / CBOR / Prototext / BSON downcast big integers to their widest native
// numeric type (int64 / double / decimal128) and lose precision above that ceiling. JCS additionally
// caps at {@code Long.MAX_VALUE} via {@code BigInteger.longValueExact} per RFC 8785. The matrix below
// stays under that ceiling but still exceeds the JavaScript {@code 2^53 − 1} safe-integer limit, which
@@ -247,7 +247,7 @@ class BigNumberFormat_BigInteger_RoundTrip_Test extends TestBase {
void a04_bigIntegerProperty_largeValues(RoundTrip_Tester t, BigNumberFormat fmt) throws Exception {
var x = new A04Bean();
x.longMax = BigInteger.valueOf(Long.MAX_VALUE);
- // Long.MIN_VALUE + 1 instead of Long.MIN_VALUE: the Proto tokenizer parses signed integers by
+ // Long.MIN_VALUE + 1 instead of Long.MIN_VALUE: the Prototext tokenizer parses signed integers by
// tokenising magnitude-first then applying sign, so the literal "-9223372036854775808" overflows on
// the unsigned magnitude side. Long.MIN_VALUE + 1's magnitude == Long.MAX_VALUE which fits.
x.longMinPlusOne = BigInteger.valueOf(Long.MIN_VALUE + 1L);
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
index 254cd2fa92..fe742b7645 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
@@ -49,7 +49,7 @@ import org.junit.jupiter.params.provider.*;
*
* <p>
* {@link BinaryFormat} only affects text-based serializers per the class-level "Binary serializers" note —
- * BSON / CBOR / MsgPack / Proto / Parquet emit native bytes regardless of the configured constant. The
+ * BSON / CBOR / MsgPack / Prototext / Parquet emit native bytes regardless of the configured constant. The
* variant {@code binarySwap} installed by {@code MarshalledPropertyPostProcessor} respects that by handing
* the raw {@code byte[]} back to {@link org.apache.juneau.marshall.serializer.OutputStreamSerializerSession}
* subtypes instead of the formatted wire string, so bean-property round-trips through binary serializers
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
index b0efb88100..dc1b32f8cc 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
@@ -53,7 +53,7 @@ import org.junit.jupiter.params.provider.*;
*
* <p>
* Per the {@link BooleanFormat} class-level "Binary serializers" note, the binary serializer family
- * (BSON / CBOR / MsgPack / Proto / Parquet) emits a native boolean wire type regardless of the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emits a native boolean wire type regardless of the
* configured constant. The variant {@code booleanSwap} installed by
* {@link org.apache.juneau.marshall.MarshalledPropertyPostProcessor} respects that by returning the raw
* {@link Boolean} to {@link org.apache.juneau.marshall.serializer.OutputStreamSerializerSession} subtypes
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
index e964df4678..d4b19f77cb 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
@@ -50,18 +50,18 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link FloatFormat} only controls how non-finite values ({@code NaN}, {@code ±Infinity}) are emitted on
* <b>text-based</b> wire formats; finite values ride the natural bare-numeric token and binary serializers
- * (BSON / CBOR / MsgPack / Proto / Parquet) emit native IEEE-754 regardless of this setting per the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emit native IEEE-754 regardless of this setting per the
* {@link FloatFormat} class-level "Binary serializers" note. The matrix below exercises finite values across
* all five {@link FloatFormat} constants for the standard tests, with a dedicated non-finite test
* ({@link #a04_doubleProperty_nonFinite}) that skips {@link FloatFormat#NaN_AS_ERROR} (throws on swap) and
* canonicalises against the format-specific wire shape via {@link #expectedAfterNonFinite}.
*
* <p>
- * Unlike the {@link Float} sibling, this file has no Proto-skip helper — the Proto text-format tokenizer
+ * Unlike the {@link Float} sibling, this file has no Prototext-skip helper — the Prototext text-format tokenizer
* bugs that forced those skips (Bug #4a — neg-flag discard on the Double return path of
* {@code readDecimalOrFloat}; Bug #4b — {@code 0.x} mis-tokenisation in {@code lexNumber}'s `0`-prefix
* branch) were both fixed before this file landed (see the work item 57 notes). The {@code a04} non-finite
- * test still skips Proto in the {@link Float} sibling because Bug #4c ({@code mightStartNumber}
+ * test still skips Prototext in the {@link Float} sibling because Bug #4c ({@code mightStartNumber}
* {@code nan}/{@code inf} asymmetry) is still open — same predicate carried into this file for the same
* reason.
*/
@@ -152,7 +152,7 @@ class FloatFormat_Double_RoundTrip_Test extends TestBase {
* Returns <jk>true</jk> when {@code t} is wrapped around a binary serializer (any
* {@link OutputStreamSerializer} subtype). Binary serializers emit native IEEE-754 regardless of
* {@link FloatFormat} per the class-level "Binary serializers" note, so non-finite values round-trip
- * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Proto,
+ * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Prototext,
* and the RDF stream variants (RdfThrift / RdfProto).
*/
private static boolean isBinarySerializer(RoundTrip_Tester t) {
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
index 6c9812af2b..19feddff3a 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
@@ -50,7 +50,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link FloatFormat} only controls how non-finite values ({@code NaN}, {@code ±Infinity}) are emitted on
* <b>text-based</b> wire formats; finite values ride the natural bare-numeric token and binary serializers
- * (BSON / CBOR / MsgPack / Proto / Parquet) emit native IEEE-754 regardless of this setting per the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emit native IEEE-754 regardless of this setting per the
* {@link FloatFormat} class-level "Binary serializers" note. The matrix below exercises finite values across
* all five {@link FloatFormat} constants for the standard tests, with a dedicated non-finite test
* ({@link #a04_floatProperty_nonFinite}) that skips {@link FloatFormat#NaN_AS_ERROR} (throws on swap) and
@@ -143,7 +143,7 @@ class FloatFormat_Float_RoundTrip_Test extends TestBase {
* Returns <jk>true</jk> when {@code t} is wrapped around a binary serializer (any
* {@link OutputStreamSerializer} subtype). Binary serializers emit native IEEE-754 regardless of
* {@link FloatFormat} per the class-level "Binary serializers" note, so non-finite values round-trip
- * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Proto,
+ * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Prototext,
* and the RDF stream variants (RdfThrift / RdfProto).
*/
private static boolean isBinarySerializer(RoundTrip_Tester t) {
diff --git a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
index 52bf6bc05e..ab9b4bb392 100644
--- a/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall-rdf/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
@@ -44,7 +44,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link UuidFormat} is structurally lossless on text serializers — every constant preserves the full
* 128-bit value (the choice is just hyphenated / compact / URN-prefixed). Binary serializers
- * (BSON / CBOR / MsgPack / Proto) bypass the format dispatch and emit a native 16-byte binary
+ * (BSON / CBOR / MsgPack / Prototext) bypass the format dispatch and emit a native 16-byte binary
* representation; the round-trip is still lossless.
*/
@SuppressWarnings({
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BigNumberFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BigNumberFormat.java
index cd4c1673dc..7479e5414f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BigNumberFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BigNumberFormat.java
@@ -62,7 +62,7 @@ import java.math.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto) emit native numeric types regardless of the
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext) emit native numeric types regardless of the
* configured {@code BigNumberFormat}; this setting only affects text-based serializers. BSON has
* {@code decimal128} for exact decimal values; CBOR / MsgPack handle big-integer values via
* tag 2 / tag 3 with string fallback.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BinaryFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BinaryFormat.java
index 8118b3ef7d..4abd93cfe3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BinaryFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BinaryFormat.java
@@ -39,7 +39,7 @@ import java.util.*;
* {@link #HEX}, {@link #BASE64}, {@link #SPACED_HEX}, or {@link #BASE64_URL}.
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto) emit native bytes regardless of the configured
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext) emit native bytes regardless of the configured
* {@code BinaryFormat}; this setting only affects text-based serializers and the
* {@code OutputStreamSerializerSession#serializeToString(Object)} stream-to-string convenience.
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BooleanFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BooleanFormat.java
index 990ce3d548..4284f01f8e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BooleanFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/BooleanFormat.java
@@ -53,7 +53,7 @@ import static org.apache.juneau.commons.utils.ThrowableUtils.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit a native boolean wire type regardless
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit a native boolean wire type regardless
* of this setting; the setting only affects text-based serializers (JSON / XML / CSV / HOCON / TOML / etc.).
* For {@link #ZERO_ONE}, JSON / JSON5 emit the bare numeric token <c>0</c> / <c>1</c> (not the string
* <c>"0"</c> / <c>"1"</c>) so the wire shape matches an <code><jk>int</jk></code> field.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/ClassFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/ClassFormat.java
index 44e168ef0a..737e2b6de8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/ClassFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/ClassFormat.java
@@ -85,7 +85,7 @@ import static org.apache.juneau.commons.utils.ThrowableUtils.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit a UTF-8 string regardless of this
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit a UTF-8 string regardless of this
* setting — there is no native {@code Class} wire type in any supported binary format.
*/
public enum ClassFormat {
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Context.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Context.java
index 0fc3777aa0..7489638cae 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Context.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/Context.java
@@ -49,7 +49,7 @@ import org.apache.juneau.marshall.oapi.*;
import org.apache.juneau.marshall.parquet.*;
import org.apache.juneau.marshall.parser.*;
import org.apache.juneau.marshall.plaintext.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.soap.*;
import org.apache.juneau.marshall.toml.*;
@@ -439,7 +439,7 @@ public abstract class Context {
* <li class='ja'>{@link OpenApiConfig}
* <li class='ja'>{@link ParserConfig}
* <li class='ja'>{@link ParquetConfig}
- * <li class='ja'>{@link ProtoConfig}
+ * <li class='ja'>{@link PrototextConfig}
* <li class='ja'>{@link PlainTextConfig}
* <li class='ja'>{@link SerializerConfig}
* <li class='ja'>{@link SoapXmlConfig}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/CurrencyFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/CurrencyFormat.java
index 8bcb83fc58..a63b599880 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/CurrencyFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/CurrencyFormat.java
@@ -71,7 +71,7 @@ import java.util.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit a UTF-8 string regardless of this
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit a UTF-8 string regardless of this
* setting — there is no native {@code Currency} wire type in any supported binary format. The choice of
* {@code ISO_CODE} vs {@code SYMBOL} vs {@code DISPLAY_NAME} is purely about the textual content of that
* string.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/FloatFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/FloatFormat.java
index 2454e9c027..d63621893c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/FloatFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/FloatFormat.java
@@ -69,7 +69,7 @@ import static org.apache.juneau.commons.utils.ThrowableUtils.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit native IEEE-754 floats regardless
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit native IEEE-754 floats regardless
* of this setting; native non-finite representations exist in every supported binary format (BSON
* {@code double} / {@code decimal128}; CBOR's tag 22 / 23 / 24 for special floats; MsgPack {@code float64}).
* This setting only affects text-based serializers.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshalledPropertyPostProcessor.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshalledPropertyPostProcessor.java
index 6e038440d4..472c6c886d 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshalledPropertyPostProcessor.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshalledPropertyPostProcessor.java
@@ -1155,7 +1155,7 @@ final class MarshalledPropertyPostProcessor implements BeanPropertyPostProcessor
public Object swap(MarshallingSession session, Boolean o) {
if (o == null)
return null;
- // Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit native bool regardless.
+ // Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit native bool regardless.
if (session instanceof OutputStreamSerializerSession)
return o;
return BooleanFormat.format(o.booleanValue(), format);
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshallingContext.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshallingContext.java
index dc450d5eb0..a93fc6b98b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshallingContext.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/MarshallingContext.java
@@ -3631,7 +3631,7 @@ public class MarshallingContext extends Context implements ConversionFinder, Bea
*
* <p>
* Controls how {@link UUID} values are written to text-based wire formats. Binary
- * serializers (BSON / CBOR / MsgPack / Proto) emit native 16-byte binary regardless of this setting.
+ * serializers (BSON / CBOR / MsgPack / Prototext) emit native 16-byte binary regardless of this setting.
*
* @param value The value for this setting.
* @return This object.
@@ -3676,7 +3676,7 @@ public class MarshallingContext extends Context implements ConversionFinder, Bea
*
* <p>
* Controls how {@link Boolean} / <code><jk>boolean</jk></code> values are written to text-based
- * wire formats. Binary serializers (BSON / CBOR / MsgPack / Proto / Parquet) emit a native
+ * wire formats. Binary serializers (BSON / CBOR / MsgPack / Prototext / Parquet) emit a native
* boolean wire type regardless of this setting.
*
* @param value The value for this setting.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/UuidFormat.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/UuidFormat.java
index c940323853..1ac2e345eb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/UuidFormat.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/UuidFormat.java
@@ -56,7 +56,7 @@ import java.util.*;
* <h5 class='topic'>Binary serializers</h5>
*
* <p>
- * Binary serializers (BSON / CBOR / MsgPack / Proto) emit native 16-byte binary regardless of the
+ * Binary serializers (BSON / CBOR / MsgPack / Prototext) emit native 16-byte binary regardless of the
* configured {@code UuidFormat}; this setting only affects text-based serializers. BSON in particular
* uses {@code binData} subtype 4 (UUID).
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/MarshallUtils.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/MarshallUtils.java
index e79d2cea80..7e566be3b5 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/MarshallUtils.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/MarshallUtils.java
@@ -1551,14 +1551,14 @@ public final class MarshallUtils {
* Serializes a Java object to a Protocol Buffers text string.
*
* <p>
- * A shortcut for calling <c>Proto.<jsm>of</jsm>(<jv>object</jv>)</c>.
+ * A shortcut for calling <c>Prototext.<jsm>of</jsm>(<jv>object</jv>)</c>.
*
* @param object The object to serialize.
* @return The serialized object.
* @throws SerializeException If a problem occurred trying to convert the output.
*/
public static String proto(Object object) throws SerializeException {
- return Proto.of(object);
+ return Prototext.of(object);
}
/**
@@ -1571,7 +1571,7 @@ public final class MarshallUtils {
* @throws IOException Thrown by underlying stream.
*/
public static Object proto(Object object, Object output) throws SerializeException, IOException {
- return Proto.of(object, output);
+ return Prototext.of(object, output);
}
/**
@@ -1585,7 +1585,7 @@ public final class MarshallUtils {
* @throws IOException Thrown by underlying stream.
*/
public static <T> T proto(Object input, Class<T> type) throws ParseException, IOException {
- return Proto.to(input, type);
+ return Prototext.to(input, type);
}
/**
@@ -1600,33 +1600,33 @@ public final class MarshallUtils {
* @throws IOException Thrown by underlying stream.
*/
public static <T> T proto(Object input, Type type, Type... args) throws ParseException, IOException {
- return Proto.to(input, type, args);
+ return Prototext.to(input, type, args);
}
/**
* Parses a Protocol Buffers text string to the specified Java type.
*
* @param <T> The class type of the object being created.
- * @param o The Proto input string.
+ * @param o The Prototext input string.
* @param c The object type to create.
* @return The parsed object.
*/
public static <T> T proto(String o, Class<T> c) {
- return safe(() -> Proto.to(o, c));
+ return safe(() -> Prototext.to(o, c));
}
/**
* Parses a Protocol Buffers text string to the specified parameterized Java type.
*
* @param <T> The class type of the object being created.
- * @param input The Proto input string.
+ * @param input The Prototext input string.
* @param type The object type to create.
* @param args The type arguments of the class if it's a collection or map.
* @return The parsed object.
* @throws ParseException Malformed input encountered.
*/
public static <T> T proto(String input, Type type, Type... args) throws ParseException {
- return Proto.to(input, type, args);
+ return Prototext.to(input, type, args);
}
//-----------------------------------------------------------------------------------------------------------------
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Protobuf.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Protobuf.java
index 34fe4f67db..9fbf7541ba 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Protobuf.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Protobuf.java
@@ -31,7 +31,7 @@ import org.apache.juneau.marshall.serializer.*;
* Output is binary (<code><jk>byte</jk>[]</code>) in the Protocol Buffers <b>binary</b> wire format.
*
* <p>
- * Distinct from the text-format {@link Proto} marshaller (<c>text/protobuf</c>): this marshaller emits the compact,
+ * Distinct from the text-format {@link Prototext} marshaller (<c>text/protobuf</c>): this marshaller emits the compact,
* non-self-describing protobuf binary wire format and requires the target type on read.
*
* <h5 class='figure'>Examples:</h5>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Proto.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Prototext.java
similarity index 88%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Proto.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Prototext.java
index 98aeb79cac..a94f2b6dbb 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Proto.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/marshaller/Prototext.java
@@ -20,11 +20,11 @@ import java.io.*;
import java.lang.reflect.*;
import org.apache.juneau.marshall.parser.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
/**
- * A pairing of a {@link ProtoSerializer} and {@link ProtoParser} into a single class with convenience read/write methods.
+ * A pairing of a {@link PrototextSerializer} and {@link PrototextParser} into a single class with convenience read/write methods.
*
* <p>
* The general idea is to combine a single serializer and parser inside a simplified API for reading and writing POJOs.
@@ -32,14 +32,14 @@ import org.apache.juneau.marshall.serializer.*;
* <h5 class='figure'>Examples:</h5>
* <p class='bjava'>
* <jc>// Using instance.</jc>
- * Proto <jv>proto</jv> = <jk>new</jk> Proto();
+ * Prototext <jv>proto</jv> = <jk>new</jk> Prototext();
* MyPojo <jv>myPojo</jv> = <jv>proto</jv>.read(<jv>string</jv>, MyPojo.<jk>class</jk>);
* String <jv>string</jv> = <jv>proto</jv>.write(<jv>myPojo</jv>);
* </p>
* <p class='bjava'>
* <jc>// Using DEFAULT instance.</jc>
- * MyPojo <jv>myPojo</jv> = Proto.<jsf>DEFAULT</jsf>.read(<jv>string</jv>, MyPojo.<jk>class</jk>);
- * String <jv>string</jv> = Proto.<jsf>DEFAULT</jsf>.write(<jv>myPojo</jv>);
+ * MyPojo <jv>myPojo</jv> = Prototext.<jsf>DEFAULT</jsf>.read(<jv>string</jv>, MyPojo.<jk>class</jk>);
+ * String <jv>string</jv> = Prototext.<jsf>DEFAULT</jsf>.write(<jv>myPojo</jv>);
* </p>
*
* <h5 class='figure'>Example output (Map of name/age):</h5>
@@ -65,10 +65,10 @@ import org.apache.juneau.marshall.serializer.*;
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public class Proto extends CharMarshaller {
+public class Prototext extends CharMarshaller {
/** Default marshaller instance. */
- public static final Proto DEFAULT = new Proto();
+ public static final Prototext DEFAULT = new Prototext();
/**
* Serializes a Java object to a Protobuf Text Format string.
@@ -159,8 +159,8 @@ public class Proto extends CharMarshaller {
}
/** Creates using default serializer and parser. */
- public Proto() {
- this(ProtoSerializer.DEFAULT, ProtoParser.DEFAULT);
+ public Prototext() {
+ this(PrototextSerializer.DEFAULT, PrototextParser.DEFAULT);
}
/**
@@ -169,7 +169,7 @@ public class Proto extends CharMarshaller {
* @param s The serializer.
* @param p The parser.
*/
- public Proto(ProtoSerializer s, ProtoParser p) {
+ public Prototext(PrototextSerializer s, PrototextParser p) {
super(s, p);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/Protobuf.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/Protobuf.java
index 2c44dfd6f5..fc01296f66 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/Protobuf.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/Protobuf.java
@@ -26,7 +26,7 @@ import java.lang.annotation.*;
* via {@link ProtobufSerializer} and {@link ProtobufParser}.
*
* <p>
- * This is the binary-format counterpart to the text-format {@link org.apache.juneau.marshall.proto.Proto @Proto}
+ * This is the binary-format counterpart to the text-format {@link org.apache.juneau.marshall.prototext.Prototext @Prototext}
* annotation, and is kept deliberately separate from it.
*
* <p>
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/ProtobufSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/ProtobufSerializer.java
index 84c2ff0e58..b51d8353b8 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/ProtobufSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/ProtobufSerializer.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.serializer.*;
*
* <h5 class='topic'>Description</h5>
* <p>
- * Unlike the text-format {@link org.apache.juneau.marshall.proto.ProtoSerializer} (<c>text/protobuf</c>), this
+ * Unlike the text-format {@link org.apache.juneau.marshall.prototext.PrototextSerializer} (<c>text/protobuf</c>), this
* serializer emits the compact, non-self-describing protobuf binary wire format. Because the wire carries neither
* field names nor specific scalar types, a per-bean field-number/scalar-type table (cached on
* {@link ProtobufClassMeta}) is consulted during serialization. The codec is lossless for Juneau⇔Juneau
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/package-info.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/package-info.java
index bceceb47e9..f21f8e70db 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/package-info.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/protobuf/package-info.java
@@ -18,7 +18,7 @@
* Protocol Buffers <b>binary wire-format</b> marshalling support (bean/reflection-driven, no <c>.proto</c> file required).
*
* <p>
- * Unlike the text-format {@link org.apache.juneau.marshall.proto} package (<c>text/protobuf</c>), this package emits and
+ * Unlike the text-format {@link org.apache.juneau.marshall.prototext} package (<c>text/protobuf</c>), this package emits and
* parses the compact, non-self-describing protobuf <b>binary</b> wire format (<c>application/protobuf</c>). Because the
* binary wire carries neither field names nor specific scalar types, both serialization and parsing consult a per-bean
* <b>field-number ⇔ property + wire-scalar-type</b> table derived from Juneau bean metadata and cached on
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/Proto.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/Prototext.java
similarity index 91%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/Proto.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/Prototext.java
index b0f9b4dfef..b2c2b28afc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/Proto.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/Prototext.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@@ -22,7 +22,7 @@ import static java.lang.annotation.RetentionPolicy.*;
import java.lang.annotation.*;
/**
- * Annotation that can be applied to classes, fields, and methods to tweak how they are handled by {@link ProtoSerializer} and {@link ProtoParser}.
+ * Annotation that can be applied to classes, fields, and methods to tweak how they are handled by {@link PrototextSerializer} and {@link PrototextParser}.
*
* <p>
* Can be used in the following locations:
@@ -38,7 +38,7 @@ import java.lang.annotation.*;
@Target({ TYPE, FIELD, METHOD })
@Retention(RUNTIME)
@Inherited
-public @interface Proto {
+public @interface Prototext {
/**
* Comment to emit before this field in the serialized output.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextAnnotation.java
similarity index 84%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoAnnotation.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextAnnotation.java
index 2654f5033a..111a0b7e89 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextAnnotation.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
@@ -23,18 +23,18 @@ import java.lang.annotation.*;
import org.apache.juneau.commons.*;
/**
- * Utility classes and methods for the {@link Proto @Proto} annotation.
+ * Utility classes and methods for the {@link Prototext @Prototext} annotation.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public class ProtoAnnotation {
+public class PrototextAnnotation {
/**
* Prevents instantiation.
*/
- private ProtoAnnotation() {}
+ private PrototextAnnotation() {}
/**
* Builder class.
*
@@ -51,15 +51,15 @@ public class ProtoAnnotation {
* Constructor.
*/
protected Builder() {
- super(Proto.class);
+ super(Prototext.class);
}
/**
- * Instantiates a new {@link Proto @Proto} object initialized with this builder.
+ * Instantiates a new {@link Prototext @Prototext} object initialized with this builder.
*
- * @return A new {@link Proto @Proto} object.
+ * @return A new {@link Prototext @Prototext} object.
*/
- public Proto build() {
+ public Prototext build() {
return new Object(this);
}
@@ -89,12 +89,12 @@ public class ProtoAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AnnotationObject implements Proto {
+ private static class Object extends AnnotationObject implements Prototext {
private final String comment;
private final String[] description;
- Object(ProtoAnnotation.Builder b) {
+ Object(PrototextAnnotation.Builder b) {
super(b);
this.comment = b.comment;
this.description = copyOf(b.description);
@@ -112,7 +112,7 @@ public class ProtoAnnotation {
}
/** Default value */
- public static final Proto DEFAULT = create().build();
+ public static final Prototext DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApply.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApply.java
similarity index 82%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApply.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApply.java
index a127a9aa8e..e51fa6d624 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApply.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApply.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@@ -24,11 +24,11 @@ import java.lang.annotation.*;
import org.apache.juneau.marshall.*;
/**
- * Dynamically applies a {@link Proto @Proto} annotation to specified classes, methods, or fields.
+ * Dynamically applies a {@link Prototext @Prototext} annotation to specified classes, methods, or fields.
*
* <p>
* This annotation separates the <b>targeting</b> concern ({@link #on()}/{@link #onClass()}) from the
- * <b>content</b> concern ({@link #value()}), enabling {@link Proto @Proto} to be a pure data annotation
+ * <b>content</b> concern ({@link #value()}), enabling {@link Prototext @Prototext} to be a pure data annotation
* without marshall-specific application machinery.
*
* <h5 class='section'>See Also:</h5><ul>
@@ -38,16 +38,16 @@ import org.apache.juneau.marshall.*;
@Documented
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
-@Repeatable(ProtoApply.Array.class)
-@ContextApply(ProtoApplyAnnotation.Applier.class)
-public @interface ProtoApply {
+@Repeatable(PrototextApply.Array.class)
+@ContextApply(PrototextApplyAnnotation.Applier.class)
+public @interface PrototextApply {
/**
- * The {@link Proto @Proto} annotation to apply.
+ * The {@link Prototext @Prototext} annotation to apply.
*
* @return The annotation value.
*/
- Proto value();
+ Prototext value();
/**
* Dynamically apply this annotation to the specified classes/methods/fields.
@@ -72,7 +72,7 @@ public @interface ProtoApply {
Class<?>[] onClass() default {};
/**
- * A collection of {@link ProtoApply @ProtoApply annotations}.
+ * A collection of {@link PrototextApply @PrototextApply annotations}.
*/
@Documented
@Target({ TYPE, METHOD })
@@ -84,6 +84,6 @@ public @interface ProtoApply {
*
* @return The annotation value.
*/
- ProtoApply[] value();
+ PrototextApply[] value();
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApplyAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApplyAnnotation.java
similarity index 78%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApplyAnnotation.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApplyAnnotation.java
index 3797fb6bd0..cfaebea91b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoApplyAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextApplyAnnotation.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
@@ -27,23 +27,23 @@ import org.apache.juneau.commons.svl.*;
import org.apache.juneau.marshall.*;
/**
- * Utility classes and methods for the {@link ProtoApply @ProtoApply} annotation.
+ * Utility classes and methods for the {@link PrototextApply @PrototextApply} annotation.
*
*/
-public class ProtoApplyAnnotation {
+public class PrototextApplyAnnotation {
/**
* Prevents instantiation.
*/
- private ProtoApplyAnnotation() {}
+ private PrototextApplyAnnotation() {}
/**
- * Applies targeted {@link ProtoApply} annotations to a {@link org.apache.juneau.marshall.Context.Builder}.
+ * Applies targeted {@link PrototextApply} annotations to a {@link org.apache.juneau.marshall.Context.Builder}.
*/
@SuppressWarnings({
"rawtypes" // Raw types required for reflective annotation application.
})
- public static class Applier extends AnnotationApplier<ProtoApply,Context.Builder> {
+ public static class Applier extends AnnotationApplier<PrototextApply,Context.Builder> {
/**
* Constructor.
@@ -51,12 +51,12 @@ public class ProtoApplyAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public Applier(VarResolverSession vr) {
- super(ProtoApply.class, Context.Builder.class, vr);
+ super(PrototextApply.class, Context.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<ProtoApply> ai, Context.Builder b) {
- ProtoApply a = ai.inner();
+ public void apply(AnnotationInfo<PrototextApply> ai, Context.Builder b) {
+ PrototextApply a = ai.inner();
if (isEmptyArray(a.on()) && isEmptyArray(a.onClass()))
return;
b.annotations(a);
@@ -72,22 +72,22 @@ public class ProtoApplyAnnotation {
*/
public static class Builder extends AppliedAnnotationObject.BuilderTMF {
- Proto value = ProtoAnnotation.DEFAULT;
+ Prototext value = PrototextAnnotation.DEFAULT;
/**
* Constructor.
*/
protected Builder() {
- super(ProtoApply.class);
+ super(PrototextApply.class);
}
/**
- * Sets the {@link ProtoApply#value()} property on this annotation.
+ * Sets the {@link PrototextApply#value()} property on this annotation.
*
* @param value The new value for this property.
* @return This object.
*/
- public Builder value(Proto value) {
+ public Builder value(Prototext value) {
this.value = value;
return this;
}
@@ -147,11 +147,11 @@ public class ProtoApplyAnnotation {
}
/**
- * Instantiates a new {@link ProtoApply @ProtoApply} object initialized with this builder.
+ * Instantiates a new {@link PrototextApply @PrototextApply} object initialized with this builder.
*
- * @return A new {@link ProtoApply} object.
+ * @return A new {@link PrototextApply} object.
*/
- public ProtoApply build() {
+ public PrototextApply build() {
return new Object(this);
}
}
@@ -159,23 +159,23 @@ public class ProtoApplyAnnotation {
@SuppressWarnings({
"java:S2160" // equals() inherited from AnnotationObject compares all annotation interface methods; subclass fields are accessed via those methods
})
- private static class Object extends AppliedOnClassAnnotationObject implements ProtoApply {
+ private static class Object extends AppliedOnClassAnnotationObject implements PrototextApply {
- private final Proto value;
+ private final Prototext value;
- Object(ProtoApplyAnnotation.Builder b) {
+ Object(PrototextApplyAnnotation.Builder b) {
super(b);
value = b.value;
}
- @Override /* Overridden from ProtoApply */
- public Proto value() {
+ @Override /* Overridden from PrototextApply */
+ public Prototext value() {
return value;
}
}
/** Default value */
- public static final ProtoApply DEFAULT = create().build();
+ public static final PrototextApply DEFAULT = create().build();
/**
* Instantiates a new builder for this class.
@@ -212,7 +212,7 @@ public class ProtoApplyAnnotation {
* @param a The annotation to check.
* @return <jk>true</jk> if the specified annotation contains all default values.
*/
- public static boolean empty(ProtoApply a) {
+ public static boolean empty(PrototextApply a) {
return a == null || DEFAULT.equals(a);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoBeanPropertyMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextBeanPropertyMeta.java
similarity index 73%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoBeanPropertyMeta.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextBeanPropertyMeta.java
index 998b10b7ee..9177b016e3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoBeanPropertyMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextBeanPropertyMeta.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.StringUtils.*;
import static org.apache.juneau.commons.utils.StringUtils.emptyIfNull;
@@ -24,19 +24,19 @@ import org.apache.juneau.commons.bean.*;
import org.apache.juneau.marshall.*;
/**
- * Metadata on bean properties specific to the Proto serializers and parsers pulled from the {@link Proto @Proto}
+ * Metadata on bean properties specific to the Prototext serializers and parsers pulled from the {@link Prototext @Prototext}
* annotation on the bean property.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public class ProtoBeanPropertyMeta extends ExtendedBeanPropertyMeta {
+public class PrototextBeanPropertyMeta extends ExtendedBeanPropertyMeta {
/**
* Default instance.
*/
- public static final ProtoBeanPropertyMeta DEFAULT = new ProtoBeanPropertyMeta();
+ public static final PrototextBeanPropertyMeta DEFAULT = new PrototextBeanPropertyMeta();
private final String comment;
@@ -44,22 +44,22 @@ public class ProtoBeanPropertyMeta extends ExtendedBeanPropertyMeta {
* Constructor.
*
* @param bpm The metadata of the bean property of this additional metadata.
- * @param mp Proto metadata provider (for finding information about other artifacts).
+ * @param mp Prototext metadata provider (for finding information about other artifacts).
*/
- public ProtoBeanPropertyMeta(BeanPropertyMeta bpm, ProtoMetaProvider mp) {
+ public PrototextBeanPropertyMeta(BeanPropertyMeta bpm, PrototextMetaProvider mp) {
super(bpm);
- var first = getBeanPropertyMeta().getAnnotations(Proto.class).findFirst();
+ var first = getBeanPropertyMeta().getAnnotations(Prototext.class).findFirst();
var c = first.map(ai -> nullIfEmpty(trim(ai.inner().comment()))).orElse("");
this.comment = emptyIfNull(c);
}
- private ProtoBeanPropertyMeta() {
+ private PrototextBeanPropertyMeta() {
super(null);
this.comment = "";
}
/**
- * Returns the comment to emit before this field (from {@link Proto#comment()}).
+ * Returns the comment to emit before this field (from {@link Prototext#comment()}).
*
* @return The comment, or empty string if none.
*/
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoClassMeta.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextClassMeta.java
similarity index 74%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoClassMeta.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextClassMeta.java
index d213959440..8c5cb88c7e 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoClassMeta.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextClassMeta.java
@@ -14,27 +14,27 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import org.apache.juneau.marshall.*;
/**
- * Metadata on classes specific to the Proto serializers and parsers pulled from the {@link Proto @Proto} annotation on
+ * Metadata on classes specific to the Prototext serializers and parsers pulled from the {@link Prototext @Prototext} annotation on
* the class.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public class ProtoClassMeta extends ExtendedClassMeta {
+public class PrototextClassMeta extends ExtendedClassMeta {
/**
* Constructor.
*
* @param cm The class that this annotation is defined on.
- * @param mp Proto metadata provider (for finding information about other artifacts).
+ * @param mp Prototext metadata provider (for finding information about other artifacts).
*/
- public ProtoClassMeta(ClassMeta<?> cm, ProtoMetaProvider mp) {
+ public PrototextClassMeta(ClassMeta<?> cm, PrototextMetaProvider mp) {
super(cm);
}
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfig.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfig.java
similarity index 90%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfig.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfig.java
index a737b52e61..b28f546f29 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfig.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfig.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.*;
@@ -24,7 +24,7 @@ import java.lang.annotation.*;
import org.apache.juneau.marshall.*;
/**
- * Annotation for specifying config properties defined in {@link ProtoSerializer} and {@link ProtoParser}.
+ * Annotation for specifying config properties defined in {@link PrototextSerializer} and {@link PrototextParser}.
*
* <p>
* Used primarily for specifying bean configuration properties on REST classes and methods.
@@ -36,8 +36,8 @@ import org.apache.juneau.marshall.*;
@Target({ TYPE, METHOD })
@Retention(RUNTIME)
@Inherited
-@ContextApply({ ProtoConfigAnnotation.SerializerApply.class, ProtoConfigAnnotation.ParserApply.class })
-public @interface ProtoConfig {
+@ContextApply({ PrototextConfigAnnotation.SerializerApply.class, PrototextConfigAnnotation.ParserApply.class })
+public @interface PrototextConfig {
/**
* Use list syntax for bean collections.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfigAnnotation.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfigAnnotation.java
similarity index 65%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfigAnnotation.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfigAnnotation.java
index 25b1647d3b..7566bcb4cc 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoConfigAnnotation.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextConfigAnnotation.java
@@ -14,30 +14,30 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import org.apache.juneau.commons.reflect.*;
import org.apache.juneau.commons.svl.*;
import org.apache.juneau.marshall.*;
/**
- * Utility classes and methods for the {@link ProtoConfig @ProtoConfig} annotation.
+ * Utility classes and methods for the {@link PrototextConfig @PrototextConfig} annotation.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public class ProtoConfigAnnotation {
+public class PrototextConfigAnnotation {
/**
* Prevents instantiation.
*/
- private ProtoConfigAnnotation() {}
+ private PrototextConfigAnnotation() {}
/**
- * Applies {@link ProtoConfig} annotations to a {@link org.apache.juneau.marshall.proto.ProtoParser.Builder}.
+ * Applies {@link PrototextConfig} annotations to a {@link org.apache.juneau.marshall.prototext.PrototextParser.Builder}.
*/
- public static class ParserApply extends AnnotationApplier<ProtoConfig,ProtoParser.Builder> {
+ public static class ParserApply extends AnnotationApplier<PrototextConfig,PrototextParser.Builder> {
/**
* Constructor.
@@ -45,19 +45,19 @@ public class ProtoConfigAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public ParserApply(VarResolverSession vr) {
- super(ProtoConfig.class, ProtoParser.Builder.class, vr);
+ super(PrototextConfig.class, PrototextParser.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<ProtoConfig> ai, ProtoParser.Builder b) {
- // No-op: ProtoParser has no config options from ProtoConfig
+ public void apply(AnnotationInfo<PrototextConfig> ai, PrototextParser.Builder b) {
+ // No-op: PrototextParser has no config options from PrototextConfig
}
}
/**
- * Applies {@link ProtoConfig} annotations to a {@link org.apache.juneau.marshall.proto.ProtoSerializer.Builder}.
+ * Applies {@link PrototextConfig} annotations to a {@link org.apache.juneau.marshall.prototext.PrototextSerializer.Builder}.
*/
- public static class SerializerApply extends AnnotationApplier<ProtoConfig,ProtoSerializer.Builder> {
+ public static class SerializerApply extends AnnotationApplier<PrototextConfig,PrototextSerializer.Builder> {
/**
* Constructor.
@@ -65,11 +65,11 @@ public class ProtoConfigAnnotation {
* @param vr The resolver for resolving values in annotations.
*/
public SerializerApply(VarResolverSession vr) {
- super(ProtoConfig.class, ProtoSerializer.Builder.class, vr);
+ super(PrototextConfig.class, PrototextSerializer.Builder.class, vr);
}
@Override
- public void apply(AnnotationInfo<ProtoConfig> ai, ProtoSerializer.Builder b) {
+ public void apply(AnnotationInfo<PrototextConfig> ai, PrototextSerializer.Builder b) {
var a = ai.inner();
bool(a.useListSyntaxForBeans()).ifPresent(b::useListSyntaxForBeans);
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoMetaProvider.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextMetaProvider.java
similarity index 80%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoMetaProvider.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextMetaProvider.java
index f44729e83e..f26463d88c 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoMetaProvider.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextMetaProvider.java
@@ -14,19 +14,19 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import org.apache.juneau.commons.bean.*;
import org.apache.juneau.marshall.*;
/**
- * Interface for providing access to {@link ProtoClassMeta} and {@link ProtoBeanPropertyMeta} objects.
+ * Interface for providing access to {@link PrototextClassMeta} and {@link PrototextBeanPropertyMeta} objects.
*
* <h5 class='section'>See Also:</h5><ul>
* <li class='link'><a class="doclink" href="https://juneau.apache.org/docs/topics/ProtobufBasics">Protobuf Text Format Basics</a>
* </ul>
*/
-public interface ProtoMetaProvider {
+public interface PrototextMetaProvider {
/**
* Returns the language-specific metadata on the specified bean property.
@@ -34,7 +34,7 @@ public interface ProtoMetaProvider {
* @param bpm The bean property to return the metadata on.
* @return The metadata.
*/
- ProtoBeanPropertyMeta getProtoBeanPropertyMeta(BeanPropertyMeta bpm);
+ PrototextBeanPropertyMeta getPrototextBeanPropertyMeta(BeanPropertyMeta bpm);
/**
* Returns the language-specific metadata on the specified class.
@@ -42,5 +42,5 @@ public interface ProtoMetaProvider {
* @param cm The class to return the metadata on.
* @return The metadata.
*/
- ProtoClassMeta getProtoClassMeta(ClassMeta<?> cm);
+ PrototextClassMeta getPrototextClassMeta(ClassMeta<?> cm);
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParser.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParser.java
similarity index 73%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParser.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParser.java
index 1867050ddc..b7057ed9ba 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParser.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParser.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.AssertionUtils.*;
@@ -78,13 +78,13 @@ import org.apache.juneau.marshall.stream.*;
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Use the default parser to parse into a bean</jc>
- * MyBean <jv>bean</jv> = ProtoParser.<jsf>DEFAULT</jsf>.parse(<jv>input</jv>, MyBean.<jk>class</jk>);
+ * MyBean <jv>bean</jv> = PrototextParser.<jsf>DEFAULT</jsf>.parse(<jv>input</jv>, MyBean.<jk>class</jk>);
*
* <jc>// Parse into an untyped map</jc>
- * JsonMap <jv>map</jv> = ProtoParser.<jsf>DEFAULT</jsf>.parse(<jv>input</jv>, JsonMap.<jk>class</jk>);
+ * JsonMap <jv>map</jv> = PrototextParser.<jsf>DEFAULT</jsf>.parse(<jv>input</jv>, JsonMap.<jk>class</jk>);
*
* <jc>// Create a parser with validate-end enabled</jc>
- * ProtoParser <jv>parser</jv> = ProtoParser.<jsm>create</jsm>().build();
+ * PrototextParser <jv>parser</jv> = PrototextParser.<jsm>create</jsm>().build();
* MyBean <jv>bean</jv> = <jv>parser</jv>.parse(<jv>input</jv>, MyBean.<jk>class</jk>);
* </p>
*
@@ -98,17 +98,17 @@ import org.apache.juneau.marshall.stream.*;
"java:S115", // ARG_ prefix follows framework convention
"resource" // Closeable resources are owned by the caller's parser session; Eclipse JDT @Owning warning is by design.
})
-public class ProtoParser extends ReaderParser implements ProtoMetaProvider, RecordReadable {
+public class PrototextParser extends ReaderParser implements PrototextMetaProvider, RecordReadable {
private static final String ARG_copyFrom = "copyFrom";
/**
- * Builder for {@link ProtoParser}.
+ * Builder for {@link PrototextParser}.
*/
public static class Builder extends ReaderParser.Builder<Builder> {
- private static final Cache<HashKey, ProtoParser> CACHE =
- Cache.of(HashKey.class, ProtoParser.class).build();
+ private static final Cache<HashKey, PrototextParser> CACHE =
+ Cache.of(HashKey.class, PrototextParser.class).build();
protected Builder() {
consumes("text/protobuf,text/x-protobuf");
@@ -118,13 +118,13 @@ public class ProtoParser extends ReaderParser implements ProtoMetaProvider, Reco
super(assertArgNotNull(ARG_copyFrom, copyFrom));
}
- protected Builder(ProtoParser copyFrom) {
+ protected Builder(PrototextParser copyFrom) {
super(assertArgNotNull(ARG_copyFrom, copyFrom));
}
@Override
- public ProtoParser build() {
- return cache(CACHE).build(ProtoParser.class);
+ public PrototextParser build() {
+ return cache(CACHE).build(PrototextParser.class);
}
@Override
@@ -134,10 +134,10 @@ public class ProtoParser extends ReaderParser implements ProtoMetaProvider, Reco
}
/** Default parser instance. */
- public static final ProtoParser DEFAULT = new ProtoParser(create());
+ public static final PrototextParser DEFAULT = new PrototextParser(create());
- private final Map<ClassMeta<?>, ProtoClassMeta> protoClassMetas = new ConcurrentHashMap<>();
- private final Map<BeanPropertyMeta, ProtoBeanPropertyMeta> protoBeanPropertyMetas = new ConcurrentHashMap<>();
+ private final Map<ClassMeta<?>, PrototextClassMeta> prototextClassMetas = new ConcurrentHashMap<>();
+ private final Map<BeanPropertyMeta, PrototextBeanPropertyMeta> prototextBeanPropertyMetas = new ConcurrentHashMap<>();
/**
* Creates a new builder.
@@ -153,13 +153,13 @@ public class ProtoParser extends ReaderParser implements ProtoMetaProvider, Reco
*
* @param builder The builder.
*/
- public ProtoParser(Builder builder) {
+ public PrototextParser(Builder builder) {
super(builder);
}
@Override
- public ProtoParserSession.Builder createSession() {
- return ProtoParserSession.create(this);
+ public PrototextParserSession.Builder createSession() {
+ return PrototextParserSession.create(this);
}
@Override
@@ -167,16 +167,16 @@ public class ProtoParser extends ReaderParser implements ProtoMetaProvider, Reco
return new Builder(this);
}
- @Override /* ProtoMetaProvider */
- public ProtoBeanPropertyMeta getProtoBeanPropertyMeta(BeanPropertyMeta bpm) {
+ @Override /* PrototextMetaProvider */
+ public PrototextBeanPropertyMeta getPrototextBeanPropertyMeta(BeanPropertyMeta bpm) {
if (bpm == null)
- return ProtoBeanPropertyMeta.DEFAULT;
- return protoBeanPropertyMetas.computeIfAbsent(bpm, k -> new ProtoBeanPropertyMeta(k.getDelegateFor(), this));
+ return PrototextBeanPropertyMeta.DEFAULT;
+ return prototextBeanPropertyMetas.computeIfAbsent(bpm, k -> new PrototextBeanPropertyMeta(k.getDelegateFor(), this));
}
- @Override /* ProtoMetaProvider */
- public ProtoClassMeta getProtoClassMeta(ClassMeta<?> cm) {
- return protoClassMetas.computeIfAbsent(cm, k -> new ProtoClassMeta(k, this));
+ @Override /* PrototextMetaProvider */
+ public PrototextClassMeta getPrototextClassMeta(ClassMeta<?> cm) {
+ return prototextClassMetas.computeIfAbsent(cm, k -> new PrototextClassMeta(k, this));
}
/**
@@ -184,9 +184,9 @@ public class ProtoParser extends ReaderParser implements ProtoMetaProvider, Reco
* <b>default session arguments</b> (mirrors {@link #parse(Object, Class)}).
*
* <p>
- * The real implementation lives on {@link ProtoParserSession#parseRecords(Object)}. Callers
+ * The real implementation lives on {@link PrototextParserSession#parseRecords(Object)}. Callers
* that need request-derived configuration (locale, timezone, schema, swaps) should call
- * {@link #createSession()} and invoke {@link ProtoParserSession#parseRecords(Object)} on the
+ * {@link #createSession()} and invoke {@link PrototextParserSession#parseRecords(Object)} on the
* built session instead.
*
* @param input The input.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParserSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParserSession.java
similarity index 82%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParserSession.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParserSession.java
index 6e532e8a1d..e5f154833f 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoParserSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextParserSession.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.AssertionUtils.*;
import static org.apache.juneau.commons.utils.CollectionUtils.isEmpty;
@@ -44,22 +44,22 @@ import org.apache.juneau.marshall.utils.*;
"java:S115", // ARG_ prefix follows framework convention
"resource" // Closeable resources are owned by the caller's parser session; Eclipse JDT @Owning warning is by design.
})
-public class ProtoParserSession extends ReaderParserSession implements RecordReadable {
+public class PrototextParserSession extends ReaderParserSession implements RecordReadable {
private static final String ARG_ctx = "ctx";
/**
- * Builder for Proto parser session.
+ * Builder for Prototext parser session.
*/
public static class Builder extends ReaderParserSession.Builder<Builder> {
- protected Builder(ProtoParser ctx) {
+ protected Builder(PrototextParser ctx) {
super(assertArgNotNull(ARG_ctx, ctx));
}
@Override
- public ProtoParserSession build() {
- return new ProtoParserSession(this);
+ public PrototextParserSession build() {
+ return new PrototextParserSession(this);
}
}
@@ -69,11 +69,11 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
* @param ctx The parser context.
* @return A new builder.
*/
- public static Builder create(ProtoParser ctx) {
+ public static Builder create(PrototextParser ctx) {
return new Builder(assertArgNotNull(ARG_ctx, ctx));
}
- protected ProtoParserSession(Builder builder) {
+ protected PrototextParserSession(Builder builder) {
super(builder);
}
@@ -92,7 +92,7 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
try (Reader r = pipe.getParserReader()) {
if (r == null)
return null;
- var t = new ProtoTokenizer(r);
+ var t = new PrototextTokenizer(r);
Map<String, Object> root = parseMessage(t, false);
if (isEmpty(root))
return type.canCreateNewBean(getOuter()) ? type.newInstance(getOuter()) : null;
@@ -101,7 +101,7 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
// Bug #12 (top-level only): when the root payload is a String-shaped byte[], consult
// the configured BinaryFormat's variant BinarySwap before falling through to convertValue's
// default String → byte[] UTF-8 coercion. Collection-element route is intentionally not
- // touched here — that surface is Bug #11 (Proto's repeated bytes field).
+ // touched here — that surface is Bug #11 (Prototext's repeated bytes field).
if (raw instanceof String s && type != null && type.inner() == byte[].class) {
var swap = type.getSwap(this);
if (swap != null)
@@ -113,14 +113,14 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
}
}
- private Map<String, Object> parseMessage(ProtoTokenizer t, boolean requireBraces) throws IOException, ParseException {
- ProtoToken.TokenType closeBrace = null;
+ private Map<String, Object> parseMessage(PrototextTokenizer t, boolean requireBraces) throws IOException, ParseException {
+ PrototextToken.TokenType closeBrace = null;
if (requireBraces) {
var tok = t.read();
- if (tok.type() == ProtoToken.TokenType.LBRACE)
- closeBrace = ProtoToken.TokenType.RBRACE;
- else if (tok.type() == ProtoToken.TokenType.LANGLE)
- closeBrace = ProtoToken.TokenType.RANGLE;
+ if (tok.type() == PrototextToken.TokenType.LBRACE)
+ closeBrace = PrototextToken.TokenType.RBRACE;
+ else if (tok.type() == PrototextToken.TokenType.LANGLE)
+ closeBrace = PrototextToken.TokenType.RANGLE;
else
return new LinkedHashMap<>();
}
@@ -130,7 +130,7 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
while (true) {
t.skipWhitespaceAndComments();
var t2 = t.peek();
- if (t2.type() == ProtoToken.TokenType.EOF)
+ if (t2.type() == PrototextToken.TokenType.EOF)
break;
if (closeBrace != null && t2.type() == closeBrace) {
t.read();
@@ -145,18 +145,18 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
t2 = t.peek();
Object value;
- if (t2.type() == ProtoToken.TokenType.COLON) {
+ if (t2.type() == PrototextToken.TokenType.COLON) {
t.read();
t.skipWhitespaceAndComments();
t2 = t.peek();
- if (t2.type() == ProtoToken.TokenType.LBRACKET) {
+ if (t2.type() == PrototextToken.TokenType.LBRACKET) {
value = parseList(t);
- } else if (t2.type() == ProtoToken.TokenType.LBRACE || t2.type() == ProtoToken.TokenType.LANGLE) {
+ } else if (t2.type() == PrototextToken.TokenType.LBRACE || t2.type() == PrototextToken.TokenType.LANGLE) {
value = parseMessage(t, true);
} else {
value = parseScalarValue(t);
}
- } else if (t2.type() == ProtoToken.TokenType.LBRACE || t2.type() == ProtoToken.TokenType.LANGLE) {
+ } else if (t2.type() == PrototextToken.TokenType.LBRACE || t2.type() == PrototextToken.TokenType.LANGLE) {
value = parseMessage(t, true);
} else {
throw t.parseException("Expected ':' or '{' after field name");
@@ -177,38 +177,38 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
t.skipWhitespaceAndComments();
t2 = t.peek();
- if (t2.type() == ProtoToken.TokenType.SEMICOLON || t2.type() == ProtoToken.TokenType.COMMA)
+ if (t2.type() == PrototextToken.TokenType.SEMICOLON || t2.type() == PrototextToken.TokenType.COMMA)
t.read();
}
return result;
}
- private static String readFieldName(ProtoTokenizer t) throws IOException, ParseException {
+ private static String readFieldName(PrototextTokenizer t) throws IOException, ParseException {
var tok = t.peek();
- if (tok.type() == ProtoToken.TokenType.IDENT)
+ if (tok.type() == PrototextToken.TokenType.IDENT)
return t.read().stringValue();
- if (tok.type() == ProtoToken.TokenType.STRING)
+ if (tok.type() == PrototextToken.TokenType.STRING)
return t.read().stringValue();
// Bare integer / hex / octal field tags (e.g. {@code 0: "first"}). Required for the
// Bug #7b residual fix on the serialize side, which emits numeric Map<K,V> keys as bare
// integer tags rather than quoted strings. The string-form of the numeric value is the
// field-name; downstream key-type coercion in convertMapToType / convertValue handles the
// conversion back to the bean property's declared key type.
- if (tok.type() == ProtoToken.TokenType.DEC_INT
- || tok.type() == ProtoToken.TokenType.HEX_INT
- || tok.type() == ProtoToken.TokenType.OCT_INT)
+ if (tok.type() == PrototextToken.TokenType.DEC_INT
+ || tok.type() == PrototextToken.TokenType.HEX_INT
+ || tok.type() == PrototextToken.TokenType.OCT_INT)
return Long.toString(t.read().numberValue().longValue());
return null;
}
- private List<Object> parseList(ProtoTokenizer t) throws IOException, ParseException {
+ private List<Object> parseList(PrototextTokenizer t) throws IOException, ParseException {
var tok = t.read();
- if (tok.type() != ProtoToken.TokenType.LBRACKET)
+ if (tok.type() != PrototextToken.TokenType.LBRACKET)
throw t.parseException("Expected '['");
var list = new ArrayList<>();
t.skipWhitespaceAndComments();
tok = t.peek();
- if (tok.type() == ProtoToken.TokenType.RBRACKET) {
+ if (tok.type() == PrototextToken.TokenType.RBRACKET) {
t.read();
return list;
}
@@ -216,11 +216,11 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
list.add(parseScalarOrMessageInList(t));
t.skipWhitespaceAndComments();
tok = t.peek();
- if (tok.type() == ProtoToken.TokenType.RBRACKET) {
+ if (tok.type() == PrototextToken.TokenType.RBRACKET) {
t.read();
break;
}
- if (tok.type() == ProtoToken.TokenType.COMMA) {
+ if (tok.type() == PrototextToken.TokenType.COMMA) {
t.read();
t.skipWhitespaceAndComments();
} else {
@@ -230,21 +230,21 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
return list;
}
- private Object parseScalarOrMessageInList(ProtoTokenizer t) throws IOException, ParseException {
+ private Object parseScalarOrMessageInList(PrototextTokenizer t) throws IOException, ParseException {
var tok = t.peek();
- if (tok.type() == ProtoToken.TokenType.LBRACE || tok.type() == ProtoToken.TokenType.LANGLE)
+ if (tok.type() == PrototextToken.TokenType.LBRACE || tok.type() == PrototextToken.TokenType.LANGLE)
return parseMessage(t, true);
return parseScalarValue(t);
}
- private static Object parseScalarValue(ProtoTokenizer t) throws IOException, ParseException {
+ private static Object parseScalarValue(PrototextTokenizer t) throws IOException, ParseException {
var tok = t.read();
- if (tok.type() == ProtoToken.TokenType.STRING) {
+ if (tok.type() == PrototextToken.TokenType.STRING) {
var sb = new StringBuilder(tok.stringValue());
while (true) {
t.skipWhitespaceAndComments();
var next = t.peek();
- if (next.type() != ProtoToken.TokenType.STRING)
+ if (next.type() != PrototextToken.TokenType.STRING)
break;
t.read();
sb.append(next.stringValue());
@@ -381,7 +381,7 @@ public class ProtoParserSession extends ReaderParserSession implements RecordRea
// (1) non-NOT_SET: consult the variant BinarySwap installed on byte[].class via
// targetType.getSwap(this); the wire is a hex / base64 string emitted by the
// swap's swap() on the serializer side.
- // (2) NOT_SET: BinarySwap.match returns 0 so no swap fires. The Proto serializer's
+ // (2) NOT_SET: BinarySwap.match returns 0 so no swap fires. The Prototext serializer's
// bytesValue path emits each byte as a hex-escaped char ("\xFF" etc.); the proto
// tokenizer decodes those escapes back into a Java String where each char's code
// point equals the byte's unsigned value. Reconstruct byte[] by iterating chars.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializer.java
similarity index 79%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializer.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializer.java
index f7bc7298a0..195263fc59 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializer.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.AssertionUtils.*;
@@ -78,19 +78,19 @@ import org.apache.juneau.marshall.stream.*;
* The following direct subclasses are provided for convenience:
* <ul class='spaced-list'>
* <li>
- * {@link ProtoSerializer.Readable} - Default serializer with additional indentation spacing.
+ * {@link PrototextSerializer.Readable} - Default serializer with additional indentation spacing.
* </ul>
*
* <h5 class='section'>Example:</h5>
* <p class='bjava'>
* <jc>// Use one of the default serializers to serialize a POJO</jc>
- * String <jv>proto</jv> = ProtoSerializer.<jsf>DEFAULT</jsf>.serialize(<jv>someObject</jv>);
+ * String <jv>proto</jv> = PrototextSerializer.<jsf>DEFAULT</jsf>.serialize(<jv>someObject</jv>);
*
* <jc>// Create a custom serializer</jc>
- * ProtoSerializer <jv>serializer</jv> = ProtoSerializer.<jsm>create</jsm>().addBeanTypes().build();
+ * PrototextSerializer <jv>serializer</jv> = PrototextSerializer.<jsm>create</jsm>().addBeanTypes().build();
*
* <jc>// Clone an existing serializer and modify it</jc>
- * <jv>serializer</jv> = ProtoSerializer.<jsf>DEFAULT</jsf>.copy().useColonForMessages().build();
+ * <jv>serializer</jv> = PrototextSerializer.<jsf>DEFAULT</jsf>.copy().useColonForMessages().build();
*
* <jc>// Serialize a POJO to Protobuf Text Format</jc>
* <jv>proto</jv> = <jv>serializer</jv>.serialize(<jv>someObject</jv>);
@@ -128,7 +128,7 @@ import org.apache.juneau.marshall.stream.*;
"java:S115", // PROP_/ARG_ prefix follows framework convention
"resource" // Closeable resources are owned by the caller's serializer session; Eclipse JDT @Owning warning is by design.
})
-public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvider, RecordWritable {
+public class PrototextSerializer extends WriterSerializer implements PrototextMetaProvider, RecordWritable {
private static final String PROP_useListSyntaxForBeans = "useListSyntaxForBeans";
private static final String PROP_useColonForMessages = "useColonForMessages";
@@ -139,8 +139,8 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
*/
public static class Builder extends WriterSerializer.Builder<Builder> {
- private static final Cache<HashKey, ProtoSerializer> CACHE =
- Cache.of(HashKey.class, ProtoSerializer.class).build();
+ private static final Cache<HashKey, PrototextSerializer> CACHE =
+ Cache.of(HashKey.class, PrototextSerializer.class).build();
private boolean useListSyntaxForBeans = false;
private boolean useColonForMessages = false;
@@ -156,7 +156,7 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
useColonForMessages = copyFrom.useColonForMessages;
}
- protected Builder(ProtoSerializer copyFrom) {
+ protected Builder(PrototextSerializer copyFrom) {
super(assertArgNotNull(ARG_copyFrom, copyFrom));
useListSyntaxForBeans = copyFrom.useListSyntaxForBeans;
useColonForMessages = copyFrom.useColonForMessages;
@@ -203,8 +203,8 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
}
@Override
- public ProtoSerializer build() {
- return cache(CACHE).build(ProtoSerializer.class);
+ public PrototextSerializer build() {
+ return cache(CACHE).build(PrototextSerializer.class);
}
@Override
@@ -223,13 +223,13 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
}
/** Default serializer. */
- public static final ProtoSerializer DEFAULT = new ProtoSerializer(create());
+ public static final PrototextSerializer DEFAULT = new PrototextSerializer(create());
/** Default serializer with additional indentation. */
- public static final ProtoSerializer DEFAULT_READABLE = new ProtoSerializer(create().useWhitespace());
+ public static final PrototextSerializer DEFAULT_READABLE = new PrototextSerializer(create().useWhitespace());
/** Default serializer subclass with readable output. */
- public static class Readable extends ProtoSerializer {
+ public static class Readable extends PrototextSerializer {
/**
* Constructor.
*/
@@ -245,23 +245,23 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
protected final boolean useListSyntaxForBeans;
protected final boolean useColonForMessages;
- private final Map<ClassMeta<?>, ProtoClassMeta> protoClassMetas = new ConcurrentHashMap<>();
- private final Map<BeanPropertyMeta, ProtoBeanPropertyMeta> protoBeanPropertyMetas = new ConcurrentHashMap<>();
+ private final Map<ClassMeta<?>, PrototextClassMeta> prototextClassMetas = new ConcurrentHashMap<>();
+ private final Map<BeanPropertyMeta, PrototextBeanPropertyMeta> prototextBeanPropertyMetas = new ConcurrentHashMap<>();
/**
* Constructor.
*
* @param builder The builder.
*/
- public ProtoSerializer(Builder builder) {
+ public PrototextSerializer(Builder builder) {
super(builder);
useListSyntaxForBeans = builder.useListSyntaxForBeans;
useColonForMessages = builder.useColonForMessages;
}
@Override
- public ProtoSerializerSession.Builder createSession() {
- return ProtoSerializerSession.create(this);
+ public PrototextSerializerSession.Builder createSession() {
+ return PrototextSerializerSession.create(this);
}
@Override
@@ -276,16 +276,16 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
.a(PROP_useColonForMessages, useColonForMessages);
}
- @Override /* ProtoMetaProvider */
- public ProtoBeanPropertyMeta getProtoBeanPropertyMeta(BeanPropertyMeta bpm) {
+ @Override /* PrototextMetaProvider */
+ public PrototextBeanPropertyMeta getPrototextBeanPropertyMeta(BeanPropertyMeta bpm) {
if (bpm == null)
- return ProtoBeanPropertyMeta.DEFAULT;
- return protoBeanPropertyMetas.computeIfAbsent(bpm, k -> new ProtoBeanPropertyMeta(k.getDelegateFor(), this));
+ return PrototextBeanPropertyMeta.DEFAULT;
+ return prototextBeanPropertyMetas.computeIfAbsent(bpm, k -> new PrototextBeanPropertyMeta(k.getDelegateFor(), this));
}
- @Override /* ProtoMetaProvider */
- public ProtoClassMeta getProtoClassMeta(ClassMeta<?> cm) {
- return protoClassMetas.computeIfAbsent(cm, k -> new ProtoClassMeta(k, this));
+ @Override /* PrototextMetaProvider */
+ public PrototextClassMeta getPrototextClassMeta(ClassMeta<?> cm) {
+ return prototextClassMetas.computeIfAbsent(cm, k -> new PrototextClassMeta(k, this));
}
/**
@@ -293,9 +293,9 @@ public class ProtoSerializer extends WriterSerializer implements ProtoMetaProvid
* <b>default session arguments</b> (mirrors {@link #serialize(Object)}).
*
* <p>
- * The real implementation lives on {@link ProtoSerializerSession#serializeRecords(Object)}.
+ * The real implementation lives on {@link PrototextSerializerSession#serializeRecords(Object)}.
* Callers that need request-derived configuration should call {@link #createSession()} and
- * invoke {@link ProtoSerializerSession#serializeRecords(Object)} on the built session instead.
+ * invoke {@link PrototextSerializerSession#serializeRecords(Object)} on the built session instead.
*
* @param output The output.
* @return A new {@link RecordWriter}.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession.java
similarity index 85%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializerSession.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession.java
index 4cb03de5c8..8d27218782 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.AssertionUtils.*;
import static org.apache.juneau.commons.utils.CollectionUtils.*;
@@ -43,12 +43,12 @@ import org.apache.juneau.marshall.stream.*;
"java:S3776", // Cognitive complexity acceptable for serialize dispatch
"java:S6541" // Brain method acceptable for serializeAnything
})
-public class ProtoSerializerSession extends WriterSerializerSession implements RecordWritable {
+public class PrototextSerializerSession extends WriterSerializerSession implements RecordWritable {
private static final String ARG_ctx = "ctx";
private static final String CONST_value = "_value";
- /** Enable with -Djuneau.proto.serialize.debug=true or ProtoSerializerSession.setDebugTrace(true) */
+ /** Enable with -Djuneau.proto.serialize.debug=true or PrototextSerializerSession.setDebugTrace(true) */
private static boolean debugTrace = Boolean.getBoolean("juneau.proto.serialize.debug");
/**
@@ -62,20 +62,20 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
protected static final List<String> traceLog = new ArrayList<>();
/**
- * Builder for Proto serializer session.
+ * Builder for Prototext serializer session.
*/
public static class Builder extends WriterSerializerSession.Builder<Builder> {
- private ProtoSerializer ctx;
+ private PrototextSerializer ctx;
- protected Builder(ProtoSerializer ctx) {
+ protected Builder(PrototextSerializer ctx) {
super(assertArgNotNull(ARG_ctx, ctx));
this.ctx = ctx;
}
@Override
- public ProtoSerializerSession build() {
- return new ProtoSerializerSession(this);
+ public PrototextSerializerSession build() {
+ return new PrototextSerializerSession(this);
}
}
@@ -85,13 +85,13 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
* @param ctx The serializer context.
* @return A new builder.
*/
- public static Builder create(ProtoSerializer ctx) {
+ public static Builder create(PrototextSerializer ctx) {
return new Builder(assertArgNotNull(ARG_ctx, ctx));
}
- private final ProtoSerializer ctx;
+ private final PrototextSerializer ctx;
- protected ProtoSerializerSession(Builder builder) {
+ protected PrototextSerializerSession(Builder builder) {
super(builder);
ctx = builder.ctx;
}
@@ -110,8 +110,8 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
protected void doSerialize(SerializerPipe out, Object o) throws IOException, SerializeException {
if (o == null)
return;
- if (debugTrace) traceLog.add("[Proto] doSerialize: o=" + cn(o) + ", getExpectedRootType=" + getExpectedRootType(o).inner().getName());
- var w = getProtoWriter(out);
+ if (debugTrace) traceLog.add("[Prototext] doSerialize: o=" + cn(o) + ", getExpectedRootType=" + getExpectedRootType(o).inner().getName());
+ var w = getPrototextWriter(out);
var eType = getExpectedRootType(o);
var cm = getClassMetaForObject(o);
// For root object: if it's a bean (or toBeanMap works), serialize as bean directly to avoid
@@ -130,16 +130,16 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
serializeAnything(w, o, eType, null, null);
}
- protected final ProtoWriter getProtoWriter(SerializerPipe out) {
+ protected final PrototextWriter getPrototextWriter(SerializerPipe out) {
var output = out.getRawOutput();
- if (output instanceof ProtoWriter output2)
+ if (output instanceof PrototextWriter output2)
return output2;
- var w = new ProtoWriter(out.getWriter(), isUseWhitespace(), getMaxIndent(), isTrimStrings(), getUriResolver());
+ var w = new PrototextWriter(out.getWriter(), isUseWhitespace(), getMaxIndent(), isTrimStrings(), getUriResolver());
out.setWriter(w);
return w;
}
- private void serializeAnything(ProtoWriter out, Object o, ClassMeta<?> eType, String fieldName, BeanPropertyMeta pMeta) throws SerializeException {
+ private void serializeAnything(PrototextWriter out, Object o, ClassMeta<?> eType, String fieldName, BeanPropertyMeta pMeta) throws SerializeException {
if (o == null)
return;
if (eType == null)
@@ -151,7 +151,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
var aTypeName = aType == null ? "null" : aType.inner().getName();
var isBean = aType != null ? aType.isBean() : "n/a";
var isMap = aType != null ? aType.isMap() : "n/a";
- traceLog.add("[Proto] serializeAnything(root): push2 aType=" + aTypeName
+ traceLog.add("[Prototext] serializeAnything(root): push2 aType=" + aTypeName
+ ", isBean=" + isBean + ", isMap=" + isMap + ", isRecursion=" + isRecursion);
}
if (aType == null) {
@@ -189,7 +189,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
path = "collection";
else
path = "scalar";
- traceLog.add("[Proto] serializeAnything(root): sType=" + sType.inner().getName() + ", isBean=" + sType.isBean() + ", isMap=" + sType.isMap()
+ traceLog.add("[Prototext] serializeAnything(root): sType=" + sType.inner().getName() + ", isBean=" + sType.isBean() + ", isMap=" + sType.isMap()
+ ", path=" + path);
}
// Workaround: when isBean() is false but toBeanMap works (e.g. POJO with public fields),
@@ -247,7 +247,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
pop();
}
- private void serializeBeanMap(ProtoWriter out, BeanMap<?> m, String typeName) throws SerializeException {
+ private void serializeBeanMap(PrototextWriter out, BeanMap<?> m, String typeName) throws SerializeException {
if (isAddBeanTypes() && nn(typeName)) {
out.cr(indent);
out.scalarField("_type");
@@ -263,7 +263,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
var cMeta = (ClassMeta<?>) pMeta.getBeanInfo();
if (canIgnoreValue(pMeta, key, value))
return;
- var protoPMeta = ctx.getProtoBeanPropertyMeta(pMeta);
+ var protoPMeta = ctx.getPrototextBeanPropertyMeta(pMeta);
if (nn(protoPMeta) && !protoPMeta.getComment().isEmpty())
out.comment(protoPMeta.getComment());
out.cr(indent);
@@ -325,7 +325,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
});
}
- private void serializeMap(ProtoWriter out, Map<?, ?> map, ClassMeta<?> type) throws SerializeException {
+ private void serializeMap(PrototextWriter out, Map<?, ?> map, ClassMeta<?> type) throws SerializeException {
forEachEntry(map, e -> {
var k = toString(e.getKey());
var v = e.getValue();
@@ -354,7 +354,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
});
}
- private void serializeCollectionItem(ProtoWriter out, Object item) throws SerializeException {
+ private void serializeCollectionItem(PrototextWriter out, Object item) throws SerializeException {
var aType = getClassMetaForObject(item);
if (aType.isBean())
serializeBeanMap(out, toBeanMap(item), null);
@@ -364,7 +364,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
serializeScalarValue(out, item, aType);
}
- private void serializeBeanOrMapItem(ProtoWriter out, Object item) throws SerializeException {
+ private void serializeBeanOrMapItem(PrototextWriter out, Object item) throws SerializeException {
var aType = getClassMetaForObject(item);
if (aType.isMap())
serializeMap(out, (Map) item, aType);
@@ -372,7 +372,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
serializeBeanMap(out, toBeanMap(item), null);
}
- private void serializeCollection(ProtoWriter out, Collection<?> c, ClassMeta<?> type, String fieldName) throws SerializeException {
+ private void serializeCollection(PrototextWriter out, Collection<?> c, ClassMeta<?> type, String fieldName) throws SerializeException {
var elType = type.getElementType();
// When element type is Object, resolve actual type from first element for beans/maps
var elementIsBeanOrMap = elType.isBean() || elType.isMap();
@@ -420,7 +420,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
}
}
- private void serializeStreamable(ProtoWriter out, Object o, ClassMeta<?> sType, String fieldName) throws SerializeException {
+ private void serializeStreamable(PrototextWriter out, Object o, ClassMeta<?> sType, String fieldName) throws SerializeException {
var elType = sType.getElementType();
if (elType.isBean() || elType.isMap()) {
forEachStreamableEntry(o, sType, item -> {
@@ -442,7 +442,7 @@ public class ProtoSerializerSession extends WriterSerializerSession implements R
}
}
- private void serializeScalarValue(ProtoWriter out, Object value, ClassMeta<?> type) throws SerializeException {
+ private void serializeScalarValue(PrototextWriter out, Object value, ClassMeta<?> type) throws SerializeException {
if (value == null)
return;
// Resolve to the runtime type and apply any registered swap. Required for collection/array
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoToken.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextToken.java
similarity index 91%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoToken.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextToken.java
index b2a283e909..e45d6cbeb3 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoToken.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextToken.java
@@ -14,10 +14,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
/**
- * Token produced by {@link ProtoTokenizer} for Protobuf Text Format parsing.
+ * Token produced by {@link PrototextTokenizer} for Protobuf Text Format parsing.
*
* <p>
* Holds a {@link TokenType} and an optional value for tokens that carry data
@@ -26,7 +26,7 @@ package org.apache.juneau.marshall.proto;
* @param type The token type.
* @param value The token value (<jk>null</jk> for structural tokens).
*/
-public record ProtoToken(ProtoToken.TokenType type, Object value) {
+public record PrototextToken(PrototextToken.TokenType type, Object value) {
/**
* Token type enumeration.
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoTokenizer.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextTokenizer.java
similarity index 85%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoTokenizer.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextTokenizer.java
index 6c6a44221c..551cde5d94 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoTokenizer.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextTokenizer.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import java.io.*;
import java.util.*;
@@ -44,7 +44,7 @@ import org.apache.juneau.marshall.parser.*;
"java:S6541", // Brain method acceptable for tokenizer
"resource" // Reader field is owned by the caller; the tokenizer reads from it but does not own its lifecycle.
})
-class ProtoTokenizer {
+class PrototextTokenizer {
private static final String CONST_integerOverflow = "Integer overflow: ";
private static final String CONST_invalidFloat = "Invalid float: ";
@@ -53,9 +53,9 @@ class ProtoTokenizer {
private final Deque<Integer> pushback = new ArrayDeque<>();
private int line = 1;
private int column;
- private ProtoToken nextToken;
+ private PrototextToken nextToken;
- ProtoTokenizer(Reader reader) {
+ PrototextTokenizer(Reader reader) {
this.reader = reader == null ? new StringReader("") : reader;
}
@@ -114,43 +114,43 @@ class ProtoTokenizer {
}
}
- ProtoToken peek() throws IOException, ParseException {
+ PrototextToken peek() throws IOException, ParseException {
if (nextToken == null)
nextToken = lex();
return nextToken;
}
- ProtoToken read() throws IOException, ParseException {
+ PrototextToken read() throws IOException, ParseException {
var t = peek();
nextToken = null;
return t;
}
- private ProtoToken lex() throws IOException, ParseException {
+ private PrototextToken lex() throws IOException, ParseException {
skipWhitespaceAndComments();
int c = peekChar();
if (c < 0)
- return new ProtoToken(ProtoToken.TokenType.EOF, null);
+ return new PrototextToken(PrototextToken.TokenType.EOF, null);
switch (c) {
- case '{' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.LBRACE, null); }
- case '}' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.RBRACE, null); }
- case '<' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.LANGLE, null); }
- case '>' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.RANGLE, null); }
- case '[' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.LBRACKET, null); }
- case ']' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.RBRACKET, null); }
- case ':' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.COLON, null); }
- case ',' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.COMMA, null); }
- case ';' -> { readChar(); return new ProtoToken(ProtoToken.TokenType.SEMICOLON, null); }
- case '"' -> { return new ProtoToken(ProtoToken.TokenType.STRING, readDoubleQuotedString()); }
- case '\'' -> { return new ProtoToken(ProtoToken.TokenType.STRING, readSingleQuotedString()); }
+ case '{' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.LBRACE, null); }
+ case '}' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.RBRACE, null); }
+ case '<' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.LANGLE, null); }
+ case '>' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.RANGLE, null); }
+ case '[' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.LBRACKET, null); }
+ case ']' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.RBRACKET, null); }
+ case ':' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.COLON, null); }
+ case ',' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.COMMA, null); }
+ case ';' -> { readChar(); return new PrototextToken(PrototextToken.TokenType.SEMICOLON, null); }
+ case '"' -> { return new PrototextToken(PrototextToken.TokenType.STRING, readDoubleQuotedString()); }
+ case '\'' -> { return new PrototextToken(PrototextToken.TokenType.STRING, readSingleQuotedString()); }
default -> { /* Fall through to number/identifier handling or throw below */ }
}
if (mightStartNumber(c))
return lexNumber();
if (isLetterOrUnderscore(c))
- return new ProtoToken(ProtoToken.TokenType.IDENT, readIdentifier());
+ return new PrototextToken(PrototextToken.TokenType.IDENT, readIdentifier());
throw parseException("Unexpected character: " + (char) c);
}
@@ -211,7 +211,7 @@ class ProtoTokenizer {
return isSpecial;
}
- private ProtoToken lexNumber() throws IOException, ParseException {
+ private PrototextToken lexNumber() throws IOException, ParseException {
int c = peekChar();
boolean neg = false;
if (c == '-') {
@@ -228,28 +228,28 @@ class ProtoTokenizer {
if (next == 'x' || next == 'X') {
readChar();
long val = readHexInteger();
- return new ProtoToken(ProtoToken.TokenType.HEX_INT, neg ? -val : val);
+ return new PrototextToken(PrototextToken.TokenType.HEX_INT, neg ? -val : val);
}
if (next >= '0' && next <= '7') {
long val = readOctalInteger();
- return new ProtoToken(ProtoToken.TokenType.OCT_INT, neg ? -val : val);
+ return new PrototextToken(PrototextToken.TokenType.OCT_INT, neg ? -val : val);
}
if (next == '.' || next == 'e' || next == 'E' || next == 'f' || next == 'F') {
double val = readFloatLiteral(neg, "0");
- return new ProtoToken(ProtoToken.TokenType.FLOAT, val);
+ return new PrototextToken(PrototextToken.TokenType.FLOAT, val);
}
- return new ProtoToken(ProtoToken.TokenType.DEC_INT, 0L);
+ return new PrototextToken(PrototextToken.TokenType.DEC_INT, 0L);
}
if (c == '.') {
double val = readFloatLiteral(neg, "");
- return new ProtoToken(ProtoToken.TokenType.FLOAT, val);
+ return new PrototextToken(PrototextToken.TokenType.FLOAT, val);
}
if (c == 'i' || c == 'I' || c == 'n' || c == 'N')
return readSpecialFloatOrIdent(neg);
var result = readDecimalOrFloat(neg);
if (result instanceof Double result2)
- return new ProtoToken(ProtoToken.TokenType.FLOAT, result2);
- return new ProtoToken(ProtoToken.TokenType.DEC_INT, result);
+ return new PrototextToken(PrototextToken.TokenType.FLOAT, result2);
+ return new PrototextToken(PrototextToken.TokenType.DEC_INT, result);
}
private long readHexInteger() throws IOException, ParseException {
@@ -338,19 +338,19 @@ class ProtoTokenizer {
* token when the lowercased form is one of the proto special-float literals (nan / inf /
* infinity), or to an IDENT token otherwise.
*/
- private ProtoToken readSpecialFloatOrIdent(boolean neg) throws IOException, ParseException {
+ private PrototextToken readSpecialFloatOrIdent(boolean neg) throws IOException, ParseException {
var sb = new StringBuilder();
while (isLetterOrUnderscore(peekChar()) || Character.isDigit(peekChar()))
sb.append((char) readChar());
var s = sb.toString();
var lower = s.toLowerCase();
if (lower.equals("inf") || lower.equals("infinity"))
- return new ProtoToken(ProtoToken.TokenType.FLOAT, neg ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);
+ return new PrototextToken(PrototextToken.TokenType.FLOAT, neg ? Double.NEGATIVE_INFINITY : Double.POSITIVE_INFINITY);
if (lower.equals("nan"))
- return new ProtoToken(ProtoToken.TokenType.FLOAT, Double.NaN);
+ return new PrototextToken(PrototextToken.TokenType.FLOAT, Double.NaN);
if (neg)
throw parseException("Invalid float literal: -" + s);
- return new ProtoToken(ProtoToken.TokenType.IDENT, s);
+ return new PrototextToken(PrototextToken.TokenType.IDENT, s);
}
/**
@@ -512,23 +512,23 @@ class ProtoTokenizer {
double readFloat() throws IOException, ParseException {
var t = read();
- if (t.type() == ProtoToken.TokenType.FLOAT)
+ if (t.type() == PrototextToken.TokenType.FLOAT)
return t.numberValue().doubleValue();
- if (t.type() == ProtoToken.TokenType.DEC_INT || t.type() == ProtoToken.TokenType.HEX_INT || t.type() == ProtoToken.TokenType.OCT_INT)
+ if (t.type() == PrototextToken.TokenType.DEC_INT || t.type() == PrototextToken.TokenType.HEX_INT || t.type() == PrototextToken.TokenType.OCT_INT)
return t.numberValue().doubleValue();
throw parseException("Expected float, got " + t.type());
}
boolean readBoolean() throws IOException, ParseException {
var t = read();
- if (t.type() == ProtoToken.TokenType.IDENT) {
+ if (t.type() == PrototextToken.TokenType.IDENT) {
var s = t.stringValue().toLowerCase();
if (s.equals("true") || s.equals("t") || s.equals("1"))
return true;
if (s.equals("false") || s.equals("f") || s.equals("0"))
return false;
}
- if (t.type() == ProtoToken.TokenType.DEC_INT) {
+ if (t.type() == PrototextToken.TokenType.DEC_INT) {
long v = t.numberValue().longValue();
if (v == 0) return false;
if (v == 1) return true;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoWriter.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextWriter.java
similarity index 72%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoWriter.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextWriter.java
index 12eadaca4f..8fed94d05a 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/ProtoWriter.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/PrototextWriter.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.commons.utils.StringUtils.*;
@@ -42,7 +42,7 @@ import org.apache.juneau.marshall.serializer.*;
"java:S3776", // Cognitive complexity acceptable for protobuf formatting methods
"resource" // Writer resource managed by calling code
})
-public class ProtoWriter extends SerializerWriter {
+public class PrototextWriter extends SerializerWriter {
/**
* Constructor.
@@ -53,7 +53,7 @@ public class ProtoWriter extends SerializerWriter {
* @param trimStrings If <jk>true</jk>, trim strings before serialization.
* @param uriResolver The URI resolver.
*/
- protected ProtoWriter(Writer out, boolean useWhitespace, int maxIndent, boolean trimStrings, UriResolver uriResolver) {
+ protected PrototextWriter(Writer out, boolean useWhitespace, int maxIndent, boolean trimStrings, UriResolver uriResolver) {
super(out, useWhitespace, maxIndent, trimStrings, '"', uriResolver);
}
@@ -63,7 +63,7 @@ public class ProtoWriter extends SerializerWriter {
* @param name The field name.
* @return This object.
*/
- public ProtoWriter fieldName(String name) {
+ public PrototextWriter fieldName(String name) {
if (isBareIdentifier(name) || isBareIntegerTag(name))
w(name);
else
@@ -80,7 +80,7 @@ public class ProtoWriter extends SerializerWriter {
* @param name The field name.
* @return This object.
*/
- public ProtoWriter scalarField(String name) {
+ public PrototextWriter scalarField(String name) {
fieldName(name);
w(": ");
return this;
@@ -93,7 +93,7 @@ public class ProtoWriter extends SerializerWriter {
* @param useColon If <jk>true</jk>, include colon before brace.
* @return This object.
*/
- public ProtoWriter messageStart(String name, boolean useColon) {
+ public PrototextWriter messageStart(String name, boolean useColon) {
fieldName(name);
if (useColon)
w(": ");
@@ -108,7 +108,7 @@ public class ProtoWriter extends SerializerWriter {
* @param depth The current indentation depth for the closing brace.
* @return This object.
*/
- public ProtoWriter messageEnd(int depth) {
+ public PrototextWriter messageEnd(int depth) {
i(depth).w('}');
nl(depth);
return this;
@@ -120,7 +120,7 @@ public class ProtoWriter extends SerializerWriter {
* @param value The string value.
* @return This object.
*/
- public ProtoWriter stringValue(String value) {
+ public PrototextWriter stringValue(String value) {
if (trimStrings)
value = trim(value);
w('"').w(escapeString(value == null ? "" : value)).w('"');
@@ -133,7 +133,7 @@ public class ProtoWriter extends SerializerWriter {
* @param value The integer value.
* @return This object.
*/
- public ProtoWriter integerValue(long value) {
+ public PrototextWriter integerValue(long value) {
w(Long.toString(value));
return this;
}
@@ -144,7 +144,7 @@ public class ProtoWriter extends SerializerWriter {
* @param value The float value.
* @return This object.
*/
- public ProtoWriter floatValue(double value) {
+ public PrototextWriter floatValue(double value) {
if (Double.isNaN(value))
w("nan");
else if (value == Double.POSITIVE_INFINITY)
@@ -166,7 +166,7 @@ public class ProtoWriter extends SerializerWriter {
* @param value The boolean value.
* @return This object.
*/
- public ProtoWriter booleanValue(boolean value) {
+ public PrototextWriter booleanValue(boolean value) {
w(value ? "true" : "false");
return this;
}
@@ -177,7 +177,7 @@ public class ProtoWriter extends SerializerWriter {
* @param name The enum constant name.
* @return This object.
*/
- public ProtoWriter enumValue(String name) {
+ public PrototextWriter enumValue(String name) {
w(name == null ? "" : name);
return this;
}
@@ -188,7 +188,7 @@ public class ProtoWriter extends SerializerWriter {
* @param data The byte array.
* @return This object.
*/
- public ProtoWriter bytesValue(byte[] data) {
+ public PrototextWriter bytesValue(byte[] data) {
if (data == null)
return this;
w('"');
@@ -208,7 +208,7 @@ public class ProtoWriter extends SerializerWriter {
*
* @return This object.
*/
- public ProtoWriter listStart() {
+ public PrototextWriter listStart() {
w('[');
return this;
}
@@ -218,7 +218,7 @@ public class ProtoWriter extends SerializerWriter {
*
* @return This object.
*/
- public ProtoWriter listEnd() {
+ public PrototextWriter listEnd() {
w(']');
return this;
}
@@ -229,7 +229,7 @@ public class ProtoWriter extends SerializerWriter {
* @param text The comment text.
* @return This object.
*/
- public ProtoWriter comment(String text) {
+ public PrototextWriter comment(String text) {
if (!isEmpty(text))
w("# ").w(text).w('\n');
return this;
@@ -314,26 +314,26 @@ public class ProtoWriter extends SerializerWriter {
}
// Override return types for chaining
- @Override public ProtoWriter append(char c) { super.append(c); return this; }
- @Override public ProtoWriter append(char[] value) { super.append(value); return this; }
- @Override public ProtoWriter append(int indent, char c) { super.append(indent, c); return this; }
- @Override public ProtoWriter append(int indent, String text) { super.append(indent, text); return this; }
- @Override public ProtoWriter append(Object text) { super.append(text); return this; }
- @Override public ProtoWriter append(String text) { super.append(text); return this; }
- @Override public ProtoWriter appendIf(boolean b, char c) { super.appendIf(b, c); return this; }
- @Override public ProtoWriter appendIf(boolean b, String text) { super.appendIf(b, text); return this; }
- @Override public ProtoWriter appendln(int indent, String text) { super.appendln(indent, text); return this; }
- @Override public ProtoWriter appendln(String text) { super.appendln(text); return this; }
- @Override public ProtoWriter appendUri(Object value) { super.appendUri(value); return this; }
- @Override public ProtoWriter cr(int depth) { super.cr(depth); return this; }
- @Override public ProtoWriter cre(int depth) { super.cre(depth); return this; }
- @Override public ProtoWriter i(int indent) { super.i(indent); return this; }
- @Override public ProtoWriter ie(int indent) { super.ie(indent); return this; }
- @Override public ProtoWriter nl(int indent) { super.nl(indent); return this; }
- @Override public ProtoWriter nlIf(boolean flag, int indent) { super.nlIf(flag, indent); return this; }
- @Override public ProtoWriter q() { super.q(); return this; }
- @Override public ProtoWriter s() { super.s(); return this; }
- @Override public ProtoWriter sIf(boolean flag) { super.sIf(flag); return this; }
- @Override public ProtoWriter w(char value) { super.w(value); return this; }
- @Override public ProtoWriter w(String value) { super.w(value); return this; }
+ @Override public PrototextWriter append(char c) { super.append(c); return this; }
+ @Override public PrototextWriter append(char[] value) { super.append(value); return this; }
+ @Override public PrototextWriter append(int indent, char c) { super.append(indent, c); return this; }
+ @Override public PrototextWriter append(int indent, String text) { super.append(indent, text); return this; }
+ @Override public PrototextWriter append(Object text) { super.append(text); return this; }
+ @Override public PrototextWriter append(String text) { super.append(text); return this; }
+ @Override public PrototextWriter appendIf(boolean b, char c) { super.appendIf(b, c); return this; }
+ @Override public PrototextWriter appendIf(boolean b, String text) { super.appendIf(b, text); return this; }
+ @Override public PrototextWriter appendln(int indent, String text) { super.appendln(indent, text); return this; }
+ @Override public PrototextWriter appendln(String text) { super.appendln(text); return this; }
+ @Override public PrototextWriter appendUri(Object value) { super.appendUri(value); return this; }
+ @Override public PrototextWriter cr(int depth) { super.cr(depth); return this; }
+ @Override public PrototextWriter cre(int depth) { super.cre(depth); return this; }
+ @Override public PrototextWriter i(int indent) { super.i(indent); return this; }
+ @Override public PrototextWriter ie(int indent) { super.ie(indent); return this; }
+ @Override public PrototextWriter nl(int indent) { super.nl(indent); return this; }
+ @Override public PrototextWriter nlIf(boolean flag, int indent) { super.nlIf(flag, indent); return this; }
+ @Override public PrototextWriter q() { super.q(); return this; }
+ @Override public PrototextWriter s() { super.s(); return this; }
+ @Override public PrototextWriter sIf(boolean flag) { super.sIf(flag); return this; }
+ @Override public PrototextWriter w(char value) { super.w(value); return this; }
+ @Override public PrototextWriter w(String value) { super.w(value); return this; }
}
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/package-info.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/package-info.java
similarity index 83%
rename from juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/package-info.java
rename to juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/package-info.java
index a20e0d6f9a..ec24e5a48b 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/proto/package-info.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/prototext/package-info.java
@@ -28,12 +28,12 @@
*
* <h5 class='section'>Usage:</h5>
* <p class='bjava'>
- * String proto = ProtoSerializer.<jsf>DEFAULT</jsf>.serialize(myBean);
- * MyBean bean = ProtoParser.<jsf>DEFAULT</jsf>.parse(proto, MyBean.<jk>class</jk>);
+ * String proto = PrototextSerializer.<jsf>DEFAULT</jsf>.serialize(myBean);
+ * MyBean bean = PrototextParser.<jsf>DEFAULT</jsf>.parse(proto, MyBean.<jk>class</jk>);
*
* <jc>// Or use the marshaller:</jc>
- * String proto = Proto.<jsm>of</jsm>(myBean);
- * MyBean bean = Proto.<jsm>to</jsm>(proto, MyBean.<jk>class</jk>);
+ * String proto = Prototext.<jsm>of</jsm>(myBean);
+ * MyBean bean = Prototext.<jsm>to</jsm>(proto, MyBean.<jk>class</jk>);
* </p>
*
* <h5 class='section'>See Also:</h5><ul>
@@ -41,4 +41,4 @@
* <li class='link'><a class="doclink" href="https://protobuf.dev/reference/protobuf/textformat-spec">Protobuf Text Format Specification</a>
* </ul>
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
diff --git a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/serializer/OutputStreamSerializerSession.java b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/serializer/OutputStreamSerializerSession.java
index e402c621b7..dc96426ed9 100644
--- a/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/serializer/OutputStreamSerializerSession.java
+++ b/juneau-core/juneau-marshall/src/main/java/org/apache/juneau/marshall/serializer/OutputStreamSerializerSession.java
@@ -140,7 +140,7 @@ public class OutputStreamSerializerSession extends SerializerSession {
@Override /* Overridden from SerializerSession */
public final String serializeToString(Object o) throws SerializeException {
// Stream-to-string is a debug / display convenience for binary serializer output (BSON / MsgPack /
- // CBOR / Proto / Parquet). It always emits HEX irrespective of the configured BinaryFormat so that
+ // CBOR / Prototext / Parquet). It always emits HEX irrespective of the configured BinaryFormat so that
// downstream tooling (test fixtures, log lines, REPL output) gets a stable, copy-pasteable
// representation of the binary frame regardless of how the surrounding context configures byte[]
// cell encoding.
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/NullInclusionAndCoercion_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/NullInclusionAndCoercion_Test.java
index c7620c34e3..2924256e51 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/NullInclusionAndCoercion_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/NullInclusionAndCoercion_Test.java
@@ -27,7 +27,7 @@ import org.apache.juneau.marshall.hocon.*;
import org.apache.juneau.marshall.ini.*;
import org.apache.juneau.marshall.jcs.*;
import org.apache.juneau.marshall.json.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
@@ -527,7 +527,7 @@ class NullInclusionAndCoercion_Test extends TestBase {
var bean = new G1();
List<Serializer> serializers = List.of(
HjsonSerializer.DEFAULT, HoconSerializer.DEFAULT, IniSerializer.DEFAULT, JcsSerializer.DEFAULT,
- ProtoSerializer.DEFAULT, TomlSerializer.DEFAULT, UonSerializer.DEFAULT, XmlSerializer.DEFAULT,
+ PrototextSerializer.DEFAULT, TomlSerializer.DEFAULT, UonSerializer.DEFAULT, XmlSerializer.DEFAULT,
YamlSerializer.DEFAULT);
for (var s : serializers)
assertDoesNotThrow(() -> s.serialize(bean), () -> s.getClass().getSimpleName());
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoAnnotation_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextAnnotation_Test.java
similarity index 72%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoAnnotation_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextAnnotation_Test.java
index df51be4505..01b5881969 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoAnnotation_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextAnnotation_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.apache.juneau.TestUtils.*;
import static org.apache.juneau.junit.bct.BctAssertions.*;
@@ -28,18 +28,18 @@ import org.junit.jupiter.api.*;
@SuppressWarnings({
"java:S1186" // Empty test method intentional for framework testing
})
-class ProtoAnnotation_Test extends TestBase {
+class PrototextAnnotation_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
// Basic tests
//------------------------------------------------------------------------------------------------------------------
- Proto a1 = ProtoAnnotation.create()
+ Prototext a1 = PrototextAnnotation.create()
.comment("a")
.description("b")
.build();
- Proto a2 = ProtoAnnotation.create()
+ Prototext a2 = PrototextAnnotation.create()
.comment("a")
.description("b")
.build();
@@ -68,19 +68,19 @@ class ProtoAnnotation_Test extends TestBase {
// Comparison with declared annotations.
//------------------------------------------------------------------------------------------------------------------
- @Proto(
+ @Prototext(
comment="a",
description={ "b" }
)
public static class D1 {}
- Proto d1 = D1.class.getAnnotationsByType(Proto.class)[0];
+ Prototext d1 = D1.class.getAnnotationsByType(Prototext.class)[0];
- @Proto(
+ @Prototext(
comment="a",
description={ "b" }
)
public static class D2 {}
- Proto d2 = D2.class.getAnnotationsByType(Proto.class)[0];
+ Prototext d2 = D2.class.getAnnotationsByType(Prototext.class)[0];
@Test void d01_comparisonWithDeclarativeAnnotations() {
assertEqualsAll(a1, d1, d2);
@@ -89,97 +89,97 @@ class ProtoAnnotation_Test extends TestBase {
}
//------------------------------------------------------------------------------------------------------------------
- // ProtoApplyAnnotation tests.
+ // PrototextApplyAnnotation tests.
//------------------------------------------------------------------------------------------------------------------
public static class E02_Class {}
public static class E04_Class {}
@Test void e01_applyAnnotationDefault() {
- assertNotNull(ProtoApplyAnnotation.DEFAULT);
+ assertNotNull(PrototextApplyAnnotation.DEFAULT);
}
@Test void e02_applyAnnotationEmpty() {
- assertTrue(ProtoApplyAnnotation.empty(null));
- assertTrue(ProtoApplyAnnotation.empty(ProtoApplyAnnotation.DEFAULT));
- assertFalse(ProtoApplyAnnotation.empty(ProtoApplyAnnotation.create(E02_Class.class).build()));
+ assertTrue(PrototextApplyAnnotation.empty(null));
+ assertTrue(PrototextApplyAnnotation.empty(PrototextApplyAnnotation.DEFAULT));
+ assertFalse(PrototextApplyAnnotation.empty(PrototextApplyAnnotation.create(E02_Class.class).build()));
}
@Test void e03_applyAnnotationCreate() {
- var a = ProtoApplyAnnotation.create().build();
+ var a = PrototextApplyAnnotation.create().build();
assertNotNull(a);
}
@Test void e04_applyAnnotationCreateWithClass() {
- var a = ProtoApplyAnnotation.create(E04_Class.class).build();
+ var a = PrototextApplyAnnotation.create(E04_Class.class).build();
assertNotNull(a);
}
@Test void e05_applyAnnotationCreateWithString() {
- var a = ProtoApplyAnnotation.create("myClass").build();
+ var a = PrototextApplyAnnotation.create("myClass").build();
assertNotNull(a);
}
@Test void e06_applyAnnotationBuilderValue() {
- var proto = ProtoAnnotation.create().comment("test").build();
- var a = ProtoApplyAnnotation.create().value(proto).build();
+ var proto = PrototextAnnotation.create().comment("test").build();
+ var a = PrototextApplyAnnotation.create().value(proto).build();
assertNotNull(a);
}
//------------------------------------------------------------------------------------------------------------------
- // ProtoBeanPropertyMeta + ProtoClassMeta lookup tests.
+ // PrototextBeanPropertyMeta + PrototextClassMeta lookup tests.
//------------------------------------------------------------------------------------------------------------------
@Test void f01_protoBeanPropertyMeta_default() {
- assertNotNull(ProtoBeanPropertyMeta.DEFAULT);
+ assertNotNull(PrototextBeanPropertyMeta.DEFAULT);
}
public static class F02_Bean { public String name; }
@Test void f02_protoBeanPropertyMeta_lookup() {
- var s = ProtoSerializer.DEFAULT;
+ var s = PrototextSerializer.DEFAULT;
var bc = s.getMarshallingContext();
var bm = bc.getBeanMeta(F02_Bean.class);
assertNotNull(bm);
var bpm = bm.getPropertyMeta("name");
assertNotNull(bpm);
- assertNotNull(s.getProtoBeanPropertyMeta(bpm));
+ assertNotNull(s.getPrototextBeanPropertyMeta(bpm));
// null path
- assertNotNull(s.getProtoBeanPropertyMeta(null));
+ assertNotNull(s.getPrototextBeanPropertyMeta(null));
}
@Test void f03_protoClassMeta_lookup() {
- var s = ProtoSerializer.DEFAULT;
+ var s = PrototextSerializer.DEFAULT;
var bc = s.getMarshallingContext();
var cm = bc.getClassMeta(F02_Bean.class);
- assertNotNull(s.getProtoClassMeta(cm));
+ assertNotNull(s.getPrototextClassMeta(cm));
}
//------------------------------------------------------------------------------------------------------------------
- // ProtoConfigAnnotation tests.
+ // PrototextConfigAnnotation tests.
//------------------------------------------------------------------------------------------------------------------
- @ProtoConfig(useListSyntaxForBeans = "true")
+ @PrototextConfig(useListSyntaxForBeans = "true")
public static class G01_Bean {}
@Test void g01_protoConfigUseListSyntaxForBeans() {
- var s = ProtoSerializer.create().applyAnnotations(G01_Bean.class).build();
+ var s = PrototextSerializer.create().applyAnnotations(G01_Bean.class).build();
assertNotNull(s);
}
- @ProtoConfig(useColonForMessages = "true")
+ @PrototextConfig(useColonForMessages = "true")
public static class G02_Bean {}
@Test void g02_protoConfigUseColonForMessages() {
- var s = ProtoSerializer.create().applyAnnotations(G02_Bean.class).build();
+ var s = PrototextSerializer.create().applyAnnotations(G02_Bean.class).build();
assertNotNull(s);
}
- @ProtoConfig
+ @PrototextConfig
public static class G03_Bean {}
@Test void g03_protoConfigParserApply() {
- var p = ProtoParser.create().applyAnnotations(G03_Bean.class).build();
+ var p = PrototextParser.create().applyAnnotations(G03_Bean.class).build();
assertNotNull(p);
}
@@ -189,9 +189,9 @@ class ProtoAnnotation_Test extends TestBase {
@Test
void h01_comment() throws Exception {
- // Serialize structure with name/test; @Proto(comment) on bean field emits comment when bean is used
+ // Serialize structure with name/test; @Prototext(comment) on bean field emits comment when bean is used
var a = JsonMap.of("name", "test");
- var proto = ProtoSerializer.DEFAULT.serialize(a);
+ var proto = PrototextSerializer.DEFAULT.serialize(a);
assertNotNull(proto);
assertTrue(proto.contains("name"));
assertTrue(proto.contains("test"));
@@ -199,8 +199,8 @@ class ProtoAnnotation_Test extends TestBase {
@Test
void h02_annotationEquivalency() {
- var a = ProtoAnnotation.create().comment("x").build();
- var b = ProtoAnnotation.create().comment("x").build();
+ var a = PrototextAnnotation.create().comment("x").build();
+ var b = PrototextAnnotation.create().comment("x").build();
assertEquals(a.comment(), b.comment());
}
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoEdgeCases_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextEdgeCases_Test.java
similarity index 65%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoEdgeCases_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextEdgeCases_Test.java
index b0173ecf25..a59814c111 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoEdgeCases_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextEdgeCases_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -24,27 +24,27 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Edge case tests for ProtoSerializer and ProtoParser.
+ * Edge case tests for PrototextSerializer and PrototextParser.
*/
-class ProtoEdgeCases_Test {
+class PrototextEdgeCases_Test {
@Test
void g01_emptyInput() {
- var b = org.apache.juneau.marshall.marshaller.Proto.to("", JsonMap.class);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to("", JsonMap.class);
assertTrue(b == null || b.isEmpty());
}
@Test
void g02_onlyComments() {
- var b = org.apache.juneau.marshall.marshaller.Proto.to("# comment one\n# comment two\n", JsonMap.class);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to("# comment one\n# comment two\n", JsonMap.class);
assertTrue(b == null || b.isEmpty());
}
@Test
void g03_unicodeStrings() {
var a = JsonMap.of("name", "José", "city", "北京");
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("José", b.get("name"));
assertEquals("北京", b.get("city"));
}
@@ -53,8 +53,8 @@ class ProtoEdgeCases_Test {
void g04_veryLongStrings() {
var longStr = "x".repeat(10000);
var a = JsonMap.of("s", longStr);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals(longStr, b.get("s"));
}
@@ -63,8 +63,8 @@ class ProtoEdgeCases_Test {
var inner = JsonMap.of("x", 1);
for (var i = 0; i < 10; i++)
inner = JsonMap.of("nested", inner);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(inner);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(inner);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
for (var m = b; m != null; m = m.getMap("nested"))
if (m.containsKey("x"))
assertEquals(1L, m.get("x"));
@@ -73,7 +73,7 @@ class ProtoEdgeCases_Test {
@Test
void g06_windowsLineEndings() {
var input = "a: 1\r\nb: 2";
- var b = org.apache.juneau.marshall.marshaller.Proto.to(input, JsonMap.class);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(input, JsonMap.class);
assertEquals(1L, b.get("a"));
assertEquals(2L, b.get("b"));
}
@@ -81,7 +81,7 @@ class ProtoEdgeCases_Test {
@Test
void g07_mixedSeparators() {
var input = "a: 1\nb: 2; c: 3, d: 4";
- var b = org.apache.juneau.marshall.marshaller.Proto.to(input, JsonMap.class);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(input, JsonMap.class);
assertEquals(1L, b.get("a"));
assertEquals(2L, b.get("b"));
assertEquals(3L, b.get("c"));
@@ -93,14 +93,14 @@ class ProtoEdgeCases_Test {
var a = new JsonMap();
a.put("name", "self");
a.put("ref", a);
- assertThrows(Exception.class, () -> org.apache.juneau.marshall.marshaller.Proto.of(a));
+ assertThrows(Exception.class, () -> org.apache.juneau.marshall.marshaller.Prototext.of(a));
}
@Test
void g09_optionalProperties() {
var a = JsonMap.of("present", "yes");
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("yes", b.get("present"));
}
@@ -109,15 +109,15 @@ class ProtoEdgeCases_Test {
var a = new LinkedHashMap<String, Object>();
a.put("k1", "one");
a.put("k2", "two");
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("one", b.get("k1"));
assertEquals("two", b.get("k2"));
}
@Test
void g11_emptyMessages() {
- var a = org.apache.juneau.marshall.marshaller.Proto.to("outer { }", JsonMap.class);
+ var a = org.apache.juneau.marshall.marshaller.Prototext.to("outer { }", JsonMap.class);
var inner = a.getMap("outer");
assertNotNull(inner);
assertTrue(inner.isEmpty());
@@ -125,7 +125,7 @@ class ProtoEdgeCases_Test {
@Test
void g12_trailingComma() {
- var a = org.apache.juneau.marshall.marshaller.Proto.to("a: 1, b: 2,", JsonMap.class);
+ var a = org.apache.juneau.marshall.marshaller.Prototext.to("a: 1, b: 2,", JsonMap.class);
assertEquals(1L, a.get("a"));
assertEquals(2L, a.get("b"));
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoMediaType_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextMediaType_Test.java
similarity index 77%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoMediaType_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextMediaType_Test.java
index 28046a2802..d17e0609f8 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoMediaType_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextMediaType_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -22,20 +22,20 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Tests for Proto media type configuration.
+ * Tests for Prototext media type configuration.
*/
-class ProtoMediaType_Test {
+class PrototextMediaType_Test {
@Test
void a01_producesCorrectMediaType() {
- var ct = ProtoSerializer.DEFAULT.getResponseContentType();
+ var ct = PrototextSerializer.DEFAULT.getResponseContentType();
assertEquals("text", ct.getType());
assertEquals("protobuf", ct.getSubType());
}
@Test
void a02_consumesCorrectMediaType() {
- var types = ProtoParser.DEFAULT.getMediaTypes().stream()
+ var types = PrototextParser.DEFAULT.getMediaTypes().stream()
.map(mt -> mt.getType() + "/" + mt.getSubType())
.toList();
assertTrue(types.stream().anyMatch(t -> t.contains("protobuf")), "Expected protobuf types: " + types);
@@ -44,9 +44,9 @@ class ProtoMediaType_Test {
@Test
void a03_contentNegotiation() {
var bean = JsonMap.of("x", 1);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(bean);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(bean);
assertNotNull(proto);
- var parsed = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var parsed = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals(1L, parsed.get("x"));
}
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoParser_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextParser_Test.java
similarity index 70%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoParser_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextParser_Test.java
index 361c9b49c4..61307c938b 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoParser_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextParser_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -24,13 +24,13 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Tests for {@link ProtoParser}.
+ * Tests for {@link PrototextParser}.
*/
-class ProtoParser_Test {
+class PrototextParser_Test {
@Test
void a01_parseSimpleBean() {
- var a = ProtoParser.DEFAULT.parse("name: \"Alice\"\nage: 30\nactive: true", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("name: \"Alice\"\nage: 30\nactive: true", JsonMap.class);
assertEquals("Alice", a.get("name"));
assertEquals(30L, a.get("age"));
assertEquals(true, a.get("active"));
@@ -38,7 +38,7 @@ class ProtoParser_Test {
@Test
void a02_parseNestedBean() {
- var a = ProtoParser.DEFAULT.parse("address {\n city: \"Boston\"\n state: \"MA\"\n}", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("address {\n city: \"Boston\"\n state: \"MA\"\n}", JsonMap.class);
var addr = a.getMap("address");
assertNotNull(addr);
assertEquals("Boston", addr.get("city"));
@@ -47,7 +47,7 @@ class ProtoParser_Test {
@Test
void a03_parseDeeplyNestedBean() {
- var a = ProtoParser.DEFAULT.parse("a { b { c: 1 } }", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("a { b { c: 1 } }", JsonMap.class);
var b = a.getMap("a");
assertNotNull(b);
var c = b.getMap("b");
@@ -57,7 +57,7 @@ class ProtoParser_Test {
@Test
void a04_parseListOfStrings() {
- var a = ProtoParser.DEFAULT.parse("tags: [\"a\", \"b\", \"c\"]", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("tags: [\"a\", \"b\", \"c\"]", JsonMap.class);
var list = a.getList("tags");
assertNotNull(list);
assertEquals(List.of("a", "b", "c"), list);
@@ -65,7 +65,7 @@ class ProtoParser_Test {
@Test
void a05_parseListOfIntegers() {
- var a = ProtoParser.DEFAULT.parse("ports: [8080, 8443, 9090]", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("ports: [8080, 8443, 9090]", JsonMap.class);
var list = a.getList("ports");
assertNotNull(list);
assertEquals(3, list.size());
@@ -76,7 +76,7 @@ class ProtoParser_Test {
@Test
void a06_parseRepeatedMessages() {
- var a = ProtoParser.DEFAULT.parse(
+ var a = PrototextParser.DEFAULT.parse(
"servers { host: \"alpha\" port: 8080 }\nservers { host: \"beta\" port: 8081 }",
JsonMap.class);
var list = a.getList("servers");
@@ -88,7 +88,7 @@ class ProtoParser_Test {
@Test
void a07_parseMapProperty() {
- var a = ProtoParser.DEFAULT.parse("env { PATH: \"/usr/bin\" HOME: \"/home\" }", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("env { PATH: \"/usr/bin\" HOME: \"/home\" }", JsonMap.class);
var env = a.getMap("env");
assertNotNull(env);
assertEquals("/usr/bin", env.get("PATH"));
@@ -97,14 +97,14 @@ class ProtoParser_Test {
@Test
void a08_parseBooleans() {
- var a = ProtoParser.DEFAULT.parse("t: true f: false", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("t: true f: false", JsonMap.class);
assertEquals(true, a.get("t"));
assertEquals(false, a.get("f"));
}
@Test
void a09_parseIntegers() {
- var a = ProtoParser.DEFAULT.parse("d: 42 h: 0xFF o: 0755", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("d: 42 h: 0xFF o: 0755", JsonMap.class);
assertEquals(42L, a.get("d"));
assertEquals(255L, a.get("h"));
assertEquals(493L, a.get("o"));
@@ -112,7 +112,7 @@ class ProtoParser_Test {
@Test
void a10_parseFloats() {
- var a = ProtoParser.DEFAULT.parse("x: 3.14 inf: inf neg: -inf n: nan", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 3.14 inf: inf neg: -inf n: nan", JsonMap.class);
assertEquals(3.14, ((Number) a.get("x")).doubleValue(), 1e-6);
assertEquals(Double.POSITIVE_INFINITY, a.get("inf"));
assertEquals(Double.NEGATIVE_INFINITY, a.get("neg"));
@@ -121,47 +121,47 @@ class ProtoParser_Test {
@Test
void a11_parseStrings() {
- var a = ProtoParser.DEFAULT.parse("a: \"hello\" b: 'world'", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("a: \"hello\" b: 'world'", JsonMap.class);
assertEquals("hello", a.get("a"));
assertEquals("world", a.get("b"));
}
@Test
void a12_parseMultiPartStrings() {
- var a = ProtoParser.DEFAULT.parse("s: \"hello\" \" world\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"hello\" \" world\"", JsonMap.class);
assertEquals("hello world", a.get("s"));
}
@Test
void a13_parseComments() {
- var a = ProtoParser.DEFAULT.parse("# comment\nname: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("# comment\nname: 1", JsonMap.class);
assertEquals(1L, a.get("name"));
}
@Test
void a14_parseSemicolonSeparators() {
- var a = ProtoParser.DEFAULT.parse("a: 1; b: 2", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("a: 1; b: 2", JsonMap.class);
assertEquals(1L, a.get("a"));
assertEquals(2L, a.get("b"));
}
@Test
void a15_parseCommaSeparators() {
- var a = ProtoParser.DEFAULT.parse("a: 1, b: 2", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("a: 1, b: 2", JsonMap.class);
assertEquals(1L, a.get("a"));
assertEquals(2L, a.get("b"));
}
@Test
void a16_parseMissingFields() {
- var a = ProtoParser.DEFAULT.parse("a: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("a: 1", JsonMap.class);
assertEquals(1L, a.get("a"));
assertNull(a.get("b"));
}
@Test
void a17_parseAngleBrackets() {
- var a = ProtoParser.DEFAULT.parse("m < k: 1 >", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("m < k: 1 >", JsonMap.class);
var m = a.getMap("m");
assertNotNull(m);
assertEquals(1L, m.get("k"));
@@ -169,7 +169,7 @@ class ProtoParser_Test {
@Test
void a18_parseColonBeforeMessage() {
- var a = ProtoParser.DEFAULT.parse("m: { k: 1 }", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("m: { k: 1 }", JsonMap.class);
var m = a.getMap("m");
assertNotNull(m);
assertEquals(1L, m.get("k"));
@@ -177,13 +177,13 @@ class ProtoParser_Test {
@Test
void a19_parseEnumValues() {
- var a = ProtoParser.DEFAULT.parse("level: WARN", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("level: WARN", JsonMap.class);
assertEquals("WARN", a.get("level"));
}
@Test
void a20_parseQuotedKeys() {
- var a = ProtoParser.DEFAULT.parse("\"special.key\": \"value\"; \"key.with.dots\": 42", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("\"special.key\": \"value\"; \"key.with.dots\": 42", JsonMap.class);
assertEquals("value", a.get("special.key"));
assertEquals(42L, a.get("key.with.dots"));
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoRoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextRoundTrip_Test.java
similarity index 68%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoRoundTrip_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextRoundTrip_Test.java
index 5192b2213e..a46074a6f8 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoRoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextRoundTrip_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -25,15 +25,15 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Round-trip tests for ProtoSerializer and ProtoParser.
+ * Round-trip tests for PrototextSerializer and PrototextParser.
*/
-class ProtoRoundTrip_Test {
+class PrototextRoundTrip_Test {
@Test
void a01_simpleBeanRoundTrip() {
var a = JsonMap.of("s", "hello", "n", 42, "b", true, "x", 3.14);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("hello", b.get("s"));
assertEquals(42L, b.get("n"));
assertEquals(true, b.get("b"));
@@ -49,8 +49,8 @@ class ProtoRoundTrip_Test {
a.put("name", "Alice");
a.put("address", inner);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("Alice", b.get("name"));
var addr = b.getMap("address");
assertNotNull(addr);
@@ -68,8 +68,8 @@ class ProtoRoundTrip_Test {
a2.put("port", 8081);
var a = JsonMap.of("servers", List.of(a1, a2));
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
var list = b.getList("servers");
assertNotNull(list);
assertEquals(2, list.size());
@@ -80,8 +80,8 @@ class ProtoRoundTrip_Test {
@Test
void a04_collectionOfStringsRoundTrip() {
var a = JsonMap.of("tags", List.of("a", "b", "c"));
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals(List.of("a", "b", "c"), b.getList("tags"));
}
@@ -90,8 +90,8 @@ class ProtoRoundTrip_Test {
var a = new LinkedHashMap<String, Object>();
a.put("env", new LinkedHashMap<>(Map.of("PATH", "/usr/bin", "HOME", "/home")));
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
var env = b.getMap("env");
assertNotNull(env);
assertEquals("/usr/bin", env.get("PATH"));
@@ -101,24 +101,24 @@ class ProtoRoundTrip_Test {
@Test
void a06_enumRoundTrip() {
var a = JsonMap.of("level", "INFO");
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("INFO", b.get("level"));
}
@Test
void a07_stringEscapingRoundTrip() {
var a = JsonMap.of("s", "a\nb\tc");
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("a\nb\tc", b.get("s"));
}
@Test
void a08_booleanRoundTrip() {
var a = JsonMap.of("t", true, "f", false);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals(true, b.get("t"));
assertEquals(false, b.get("f"));
}
@@ -126,8 +126,8 @@ class ProtoRoundTrip_Test {
@Test
void a09_numericEdgeCases() {
var a = JsonMap.of("i", Integer.MAX_VALUE, "l", Long.MAX_VALUE, "d", 3.14159265358979);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals((long) Integer.MAX_VALUE, b.get("i"));
assertEquals(Long.MAX_VALUE, b.get("l"));
assertEquals(3.14159265358979, ((Number) b.get("d")).doubleValue(), 1e-10);
@@ -142,8 +142,8 @@ class ProtoRoundTrip_Test {
a.put("tags", List.of("a", "b"));
a.put("nested", inner);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("test", b.get("name"));
assertEquals(42L, b.get("count"));
assertEquals(List.of("a", "b"), b.getList("tags"));
@@ -152,7 +152,7 @@ class ProtoRoundTrip_Test {
@Test
void a11_objectSwapRoundTrip() {
- var ser = ProtoSerializer.create().binaryFormat(BinaryFormat.BASE64).build();
+ var ser = PrototextSerializer.create().binaryFormat(BinaryFormat.BASE64).build();
var a = JsonMap.of("data", new byte[] { 0x0a, 0x05, (byte) 0xff });
var proto = ser.serialize(a);
assertTrue(proto.contains("data"));
@@ -162,8 +162,8 @@ class ProtoRoundTrip_Test {
@Test
void a12_emptyCollectionsRoundTrip() {
var a = JsonMap.of("tags", List.of());
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
var list = b.getList("tags");
assertNotNull(list);
assertTrue(list.isEmpty());
@@ -177,8 +177,8 @@ class ProtoRoundTrip_Test {
a.put("nullStr", null);
a.put("nullInt", null);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("x", b.get("s"));
assertEquals(1L, b.get("n"));
assertNull(b.get("nullStr"));
@@ -188,8 +188,8 @@ class ProtoRoundTrip_Test {
@Test
void a14_topLevelScalarLimitation() {
var a = "bare";
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, String.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, String.class);
assertEquals("bare", b);
}
@@ -203,8 +203,8 @@ class ProtoRoundTrip_Test {
a.put("nest", inner);
a.put("list", List.of(1, 2, 3));
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("hello", b.get("s"));
assertEquals(42L, b.get("n"));
assertEquals(true, b.get("b"));
@@ -219,8 +219,8 @@ class ProtoRoundTrip_Test {
"localDate", "2012-12-21",
"timeout", "PT1H30M"
);
- var proto = org.apache.juneau.marshall.marshaller.Proto.of(a);
- var b = org.apache.juneau.marshall.marshaller.Proto.to(proto, JsonMap.class);
+ var proto = org.apache.juneau.marshall.marshaller.Prototext.of(a);
+ var b = org.apache.juneau.marshall.marshaller.Prototext.to(proto, JsonMap.class);
assertEquals("2012-12-21T12:34:56Z", b.get("instant"));
assertEquals("2012-12-21", b.get("localDate"));
assertEquals("PT1H30M", b.get("timeout"));
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializerSession_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession_Test.java
similarity index 84%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializerSession_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession_Test.java
index 408277447e..3179f7fe42 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializerSession_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializerSession_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -26,16 +26,16 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Tests targeting low-coverage paths in {@link ProtoSerializerSession}.
+ * Tests targeting low-coverage paths in {@link PrototextSerializerSession}.
*
- * <p>Exercises serializer paths that the higher-level Proto*_Test files don't reach:
+ * <p>Exercises serializer paths that the higher-level Prototext*_Test files don't reach:
* collections-of-beans inside beans, arrays of primitives/beans, streamable element types
* (Iterable/Iterator/Stream), nested map-of-maps, debug trace toggle, useColon/listSyntax
* options, scalar value type dispatch (Date/Calendar/Temporal/Duration/Period/byte[]), and
* bean property comments.
*/
@SuppressWarnings("unchecked")
-class ProtoSerializerSession_Test extends TestBase {
+class PrototextSerializerSession_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
// Debug trace
@@ -43,35 +43,35 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void a01_setDebugTrace_toggle() throws Exception {
// Snapshot starting state then exercise the static toggle in both directions.
- ProtoSerializerSession.setDebugTrace(true);
+ PrototextSerializerSession.setDebugTrace(true);
try {
var m = JsonMap.of("k", "v");
- var proto = ProtoSerializer.DEFAULT.serialize(m);
+ var proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("k"));
// Trace log should have captured at least one entry while debugTrace was on.
- assertFalse(ProtoSerializerSession.traceLog.isEmpty());
+ assertFalse(PrototextSerializerSession.traceLog.isEmpty());
} finally {
- ProtoSerializerSession.setDebugTrace(false);
+ PrototextSerializerSession.setDebugTrace(false);
}
}
@Test void a02_debugTrace_serializeAnythingRoot() throws Exception {
// Force serializeAnything root path (top-level Collection) with debug trace enabled.
- ProtoSerializerSession.setDebugTrace(true);
+ PrototextSerializerSession.setDebugTrace(true);
try {
- ProtoSerializerSession.traceLog.clear();
- var proto = ProtoSerializer.DEFAULT.serialize(List.of(1, 2, 3));
+ PrototextSerializerSession.traceLog.clear();
+ var proto = PrototextSerializer.DEFAULT.serialize(List.of(1, 2, 3));
assertNotNull(proto);
- assertFalse(ProtoSerializerSession.traceLog.isEmpty());
+ assertFalse(PrototextSerializerSession.traceLog.isEmpty());
} finally {
- ProtoSerializerSession.setDebugTrace(false);
+ PrototextSerializerSession.setDebugTrace(false);
}
}
@Test void a03_doSerialize_nullObject() throws Exception {
// null root must produce empty output without error.
- var proto = ProtoSerializer.DEFAULT.serialize(null);
+ var proto = PrototextSerializer.DEFAULT.serialize(null);
assertTrue(proto == null || proto.isEmpty());
}
@@ -81,32 +81,32 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void b01_topLevelString() throws Exception {
// Hits scalar root branch (CONST_value).
- var proto = ProtoSerializer.DEFAULT.serialize("hello");
+ var proto = PrototextSerializer.DEFAULT.serialize("hello");
assertNotNull(proto);
assertTrue(proto.contains("hello"));
}
@Test void b02_topLevelInteger() throws Exception {
- var proto = ProtoSerializer.DEFAULT.serialize(42);
+ var proto = PrototextSerializer.DEFAULT.serialize(42);
assertNotNull(proto);
assertTrue(proto.contains("42"));
}
@Test void b03_topLevelEnum() throws Exception {
- var proto = ProtoSerializer.DEFAULT.serialize(LogLevel.WARN);
+ var proto = PrototextSerializer.DEFAULT.serialize(LogLevel.WARN);
assertNotNull(proto);
assertTrue(proto.contains("WARN"));
}
@Test void b04_topLevelArray() throws Exception {
// Hits sType.isArray() branch in serializeAnything root path.
- var proto = ProtoSerializer.DEFAULT.serialize(new int[] { 1, 2, 3 });
+ var proto = PrototextSerializer.DEFAULT.serialize(new int[] { 1, 2, 3 });
assertNotNull(proto);
assertTrue(proto.contains("1") && proto.contains("2") && proto.contains("3"));
}
@Test void b05_topLevelStringArray() throws Exception {
- var proto = ProtoSerializer.DEFAULT.serialize(new String[] { "a", "b" });
+ var proto = PrototextSerializer.DEFAULT.serialize(new String[] { "a", "b" });
assertNotNull(proto);
assertTrue(proto.contains("a") && proto.contains("b"));
}
@@ -114,7 +114,7 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void b06_topLevelIterable() throws Exception {
// Hits sType.isStreamable() branch.
Iterable<String> it = List.of("x", "y", "z");
- var proto = ProtoSerializer.DEFAULT.serialize(it);
+ var proto = PrototextSerializer.DEFAULT.serialize(it);
assertNotNull(proto);
assertTrue(proto.contains("x"));
}
@@ -122,13 +122,13 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void b07_topLevelIterator() throws Exception {
// Hits sType.isStreamable() branch with Iterator.
Iterator<String> it = List.of("p", "q").iterator();
- var proto = ProtoSerializer.DEFAULT.serialize(it);
+ var proto = PrototextSerializer.DEFAULT.serialize(it);
assertNotNull(proto);
assertTrue(proto.contains("p"));
}
@Test void b08_topLevelEmptyArray() throws Exception {
- var proto = ProtoSerializer.DEFAULT.serialize(new int[0]);
+ var proto = PrototextSerializer.DEFAULT.serialize(new int[0]);
assertNotNull(proto);
}
@@ -149,7 +149,7 @@ class ProtoSerializerSession_Test extends TestBase {
root.put("name", "parent");
root.put("children", List.of(c1, c2));
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("alpha") && proto.contains("beta"), () -> "Expected alpha+beta in: " + proto);
assertTrue(proto.contains("children"), () -> "Expected children in: " + proto);
@@ -157,7 +157,7 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void c02_beanProperty_listOfBeans_listSyntax() throws Exception {
// useListSyntaxForBeans=true → exercise the [{...}, {...}] writer path.
- var ser = ProtoSerializer.create().useListSyntaxForBeans(true).build();
+ var ser = PrototextSerializer.create().useListSyntaxForBeans(true).build();
var c1 = new LinkedHashMap<String, Object>();
c1.put("id", 1);
c1.put("label", "alpha");
@@ -185,7 +185,7 @@ class ProtoSerializerSession_Test extends TestBase {
root.put("name", "parent");
root.put("children", arr);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("x") && proto.contains("y"), () -> "Expected x+y in: " + proto);
}
@@ -194,14 +194,14 @@ class ProtoSerializerSession_Test extends TestBase {
// int[] in a Map property — exercises array → list of scalars branch.
var root = new LinkedHashMap<String, Object>();
root.put("values", new int[] { 10, 20, 30 });
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("10") && proto.contains("20") && proto.contains("30"));
}
@Test void c05_listSyntax_useColon() throws Exception {
// Combine useListSyntaxForBeans + useColonForMessages to hit both branches.
- var ser = ProtoSerializer.create().useListSyntaxForBeans(true).useColonForMessages(true).build();
+ var ser = PrototextSerializer.create().useListSyntaxForBeans(true).useColonForMessages(true).build();
var c1 = new LinkedHashMap<String, Object>();
c1.put("label", "z");
var root = new LinkedHashMap<String, Object>();
@@ -214,7 +214,7 @@ class ProtoSerializerSession_Test extends TestBase {
}
@Test void c06_useColonForMessages_nestedBean() throws Exception {
- var ser = ProtoSerializer.create().useColonForMessages(true).build();
+ var ser = PrototextSerializer.create().useColonForMessages(true).build();
var inner = new LinkedHashMap<String, Object>();
inner.put("x", 1);
var m = new LinkedHashMap<String, Object>();
@@ -242,7 +242,7 @@ class ProtoSerializerSession_Test extends TestBase {
var root = new LinkedHashMap<String, Object>();
root.put("config", outer);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("config {"));
assertTrue(proto.contains("nested {"));
@@ -256,7 +256,7 @@ class ProtoSerializerSession_Test extends TestBase {
var root = new LinkedHashMap<String, Object>();
root.put("sub", sub);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("tags"));
assertTrue(proto.contains("a") && proto.contains("b"));
@@ -269,7 +269,7 @@ class ProtoSerializerSession_Test extends TestBase {
var root = new LinkedHashMap<String, Object>();
root.put("sub", sub);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("80") && proto.contains("443"));
}
@@ -288,7 +288,7 @@ class ProtoSerializerSession_Test extends TestBase {
var root = new LinkedHashMap<String, Object>();
root.put("entries", entries);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("first") && proto.contains("second"));
}
@@ -300,7 +300,7 @@ class ProtoSerializerSession_Test extends TestBase {
var root = new LinkedHashMap<String, Object>();
root.put("sub", sub);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertTrue(proto.contains("present"));
assertFalse(proto.contains("missing"));
}
@@ -314,7 +314,7 @@ class ProtoSerializerSession_Test extends TestBase {
Iterable<String> items = List.of("alpha", "beta");
var root = new LinkedHashMap<String, Object>();
root.put("items", items);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("alpha") && proto.contains("beta"), () -> "Expected alpha+beta in: " + proto);
}
@@ -327,7 +327,7 @@ class ProtoSerializerSession_Test extends TestBase {
// type.isDate() branch.
var root = new LinkedHashMap<String, Object>();
root.put("when", new Date(0L));
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("when"));
}
@@ -337,7 +337,7 @@ class ProtoSerializerSession_Test extends TestBase {
var cal = GregorianCalendar.from(Instant.EPOCH.atZone(ZoneOffset.UTC));
var root = new LinkedHashMap<String, Object>();
root.put("when", cal);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("when"));
}
@@ -346,7 +346,7 @@ class ProtoSerializerSession_Test extends TestBase {
// type.isTemporal() branch.
var root = new LinkedHashMap<String, Object>();
root.put("when", Instant.ofEpochMilli(0L));
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("when"));
}
@@ -355,7 +355,7 @@ class ProtoSerializerSession_Test extends TestBase {
// type.isDuration() branch.
var root = new LinkedHashMap<String, Object>();
root.put("length", Duration.ofMinutes(90));
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("length"));
assertTrue(proto.contains("PT") || proto.contains("1H"));
@@ -365,7 +365,7 @@ class ProtoSerializerSession_Test extends TestBase {
// type.isPeriod() branch.
var root = new LinkedHashMap<String, Object>();
root.put("span", Period.ofDays(7));
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("span"));
assertTrue(proto.contains("P7D") || proto.contains("D"));
@@ -375,7 +375,7 @@ class ProtoSerializerSession_Test extends TestBase {
// value instanceof byte[] branch.
var root = new LinkedHashMap<String, Object>();
root.put("payload", new byte[] { 0x01, 0x02, 0x03 });
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("payload"));
}
@@ -384,7 +384,7 @@ class ProtoSerializerSession_Test extends TestBase {
// value instanceof Float branch (separate from Double).
var root = new LinkedHashMap<String, Object>();
root.put("ratio", 3.5f);
- var proto = ProtoSerializer.DEFAULT.serialize(root);
+ var proto = PrototextSerializer.DEFAULT.serialize(root);
assertNotNull(proto);
assertTrue(proto.contains("3.5"));
}
@@ -392,7 +392,7 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void f08_keepNullProperties() throws Exception {
// keepNullProperties=true should still skip writing null values per the proto.
// However, this exercises the alternative branch in the checkNull predicate.
- var ser = ProtoSerializer.create().keepNullProperties().build();
+ var ser = PrototextSerializer.create().keepNullProperties().build();
var root = new LinkedHashMap<String, Object>();
root.put("a", null);
@@ -409,7 +409,7 @@ class ProtoSerializerSession_Test extends TestBase {
// Hits isOptional branch in serializeAnything (via map of Optional<String>).
var m = new LinkedHashMap<String, Object>();
m.put("opt", Optional.of("value"));
- var proto = ProtoSerializer.DEFAULT.serialize(m);
+ var proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("value"));
}
@@ -418,7 +418,7 @@ class ProtoSerializerSession_Test extends TestBase {
// Optional.empty() -> serializeAnything handles via getOptionalValue (returns null).
var m = new LinkedHashMap<String, Object>();
m.put("opt", Optional.empty());
- var proto = ProtoSerializer.DEFAULT.serialize(m);
+ var proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
}
@@ -427,10 +427,10 @@ class ProtoSerializerSession_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
@Test void h01_beanWithCommentedProperty() throws Exception {
- // Bean property with @Proto(comment="...") — exercises the protoPMeta comment path.
+ // Bean property with @Prototext(comment="...") — exercises the protoPMeta comment path.
var bean = new BeanWithCommentedProperty();
bean.setName("test");
- var proto = ProtoSerializer.DEFAULT.serialize(bean);
+ var proto = PrototextSerializer.DEFAULT.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("# This is the name field"));
assertTrue(proto.contains("name"));
@@ -438,14 +438,14 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void h02_beanWithListOfMaps() throws Exception {
// Bean has a List<Map> property — exercises serializeBeanMap collection-with-bean-elements
- // path (lines 270-296 in ProtoSerializerSession).
+ // path (lines 270-296 in PrototextSerializerSession).
var bean = new BeanWithListOfMaps();
var c1 = new LinkedHashMap<String, Object>();
c1.put("k", "alpha");
var c2 = new LinkedHashMap<String, Object>();
c2.put("k", "beta");
bean.setItems(List.of(c1, c2));
- var proto = ProtoSerializer.DEFAULT.serialize(bean);
+ var proto = PrototextSerializer.DEFAULT.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("alpha") && proto.contains("beta"), () -> "Expected alpha+beta in: " + proto);
}
@@ -459,7 +459,7 @@ class ProtoSerializerSession_Test extends TestBase {
var c2 = new LinkedHashMap<String, Object>();
c2.put("k", "beta");
bean.setItems(List.of(c1, c2));
- var ser = ProtoSerializer.create().useListSyntaxForBeans(true).build();
+ var ser = PrototextSerializer.create().useListSyntaxForBeans(true).build();
var proto = ser.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("[") && proto.contains("]"), () -> "Expected list syntax in: " + proto);
@@ -479,7 +479,7 @@ class ProtoSerializerSession_Test extends TestBase {
})
var arr = new Map[] { c1, c2 };
bean.setItems(arr);
- var proto = ProtoSerializer.DEFAULT.serialize(bean);
+ var proto = PrototextSerializer.DEFAULT.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("alpha") && proto.contains("beta"), () -> "Expected alpha+beta in: " + proto);
}
@@ -496,7 +496,7 @@ class ProtoSerializerSession_Test extends TestBase {
})
var arr = new Map[] { c1, c2 };
bean.setItems(arr);
- var ser = ProtoSerializer.create().useListSyntaxForBeans(true).build();
+ var ser = PrototextSerializer.create().useListSyntaxForBeans(true).build();
var proto = ser.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("[") && proto.contains("]"), () -> "Expected list syntax in: " + proto);
@@ -507,7 +507,7 @@ class ProtoSerializerSession_Test extends TestBase {
// Bean with List<String> — exercises serializeBeanMap scalar-list branch (lines 298-309).
var bean = new BeanWithListOfStrings();
bean.setTags(List.of("a", "b", "c"));
- var proto = ProtoSerializer.DEFAULT.serialize(bean);
+ var proto = PrototextSerializer.DEFAULT.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("a") && proto.contains("b") && proto.contains("c"));
}
@@ -516,7 +516,7 @@ class ProtoSerializerSession_Test extends TestBase {
// Bean with int[] — exercises serializeBeanMap array→list branch with primitive elements.
var bean = new BeanWithIntArrayProp();
bean.setValues(new int[] { 1, 2, 3 });
- var proto = ProtoSerializer.DEFAULT.serialize(bean);
+ var proto = PrototextSerializer.DEFAULT.serialize(bean);
assertNotNull(proto);
assertTrue(proto.contains("1") && proto.contains("2") && proto.contains("3"));
}
@@ -532,7 +532,7 @@ class ProtoSerializerSession_Test extends TestBase {
var c2 = new LinkedHashMap<String, Object>();
c2.put("k", "beta");
var stream = java.util.stream.Stream.of(c1, c2);
- var proto = ProtoSerializer.DEFAULT.serialize(stream);
+ var proto = PrototextSerializer.DEFAULT.serialize(stream);
assertNotNull(proto);
assertTrue(proto.contains("alpha") && proto.contains("beta"), () -> "Expected alpha+beta in: " + proto);
}
@@ -540,7 +540,7 @@ class ProtoSerializerSession_Test extends TestBase {
@Test void h08_topLevelStreamOfStrings() throws Exception {
// Top-level Stream<String> — hits serializeStreamable scalar branch.
var stream = java.util.stream.Stream.of("a", "b", "c");
- var proto = ProtoSerializer.DEFAULT.serialize(stream);
+ var proto = PrototextSerializer.DEFAULT.serialize(stream);
assertNotNull(proto);
assertTrue(proto.contains("a") && proto.contains("b") && proto.contains("c"));
}
@@ -550,7 +550,7 @@ class ProtoSerializerSession_Test extends TestBase {
//------------------------------------------------------------------------------------------------------------------
@Test void i01_create_nullCtxThrows() {
- assertThrows(IllegalArgumentException.class, () -> ProtoSerializerSession.create((ProtoSerializer) null));
+ assertThrows(IllegalArgumentException.class, () -> PrototextSerializerSession.create((PrototextSerializer) null));
}
//------------------------------------------------------------------------------------------------------------------
@@ -561,7 +561,7 @@ class ProtoSerializerSession_Test extends TestBase {
public static class BeanWithCommentedProperty {
private String name;
- @org.apache.juneau.marshall.proto.Proto(comment = "This is the name field")
+ @org.apache.juneau.marshall.prototext.Prototext(comment = "This is the name field")
public String getName() { return name; }
public void setName(String v) { name = v; }
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializer_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializer_Test.java
similarity index 83%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializer_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializer_Test.java
index 6d33223b21..cd90525de4 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoSerializer_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextSerializer_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -24,9 +24,9 @@ import org.apache.juneau.marshall.collections.*;
import org.junit.jupiter.api.*;
/**
- * Tests for {@link ProtoSerializer}.
+ * Tests for {@link PrototextSerializer}.
*/
-class ProtoSerializer_Test {
+class PrototextSerializer_Test {
@Test
void a01_simpleBean() {
@@ -36,7 +36,7 @@ class ProtoSerializer_Test {
m.put("debug", true);
m.put("ratio", 3.14);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("host:"));
assertTrue(proto.contains("localhost"));
@@ -57,7 +57,7 @@ class ProtoSerializer_Test {
config.put("name", "myapp");
config.put("database", db);
- String proto = ProtoSerializer.DEFAULT.serialize(config);
+ String proto = PrototextSerializer.DEFAULT.serialize(config);
assertNotNull(proto);
assertTrue(proto.contains("name:"));
assertTrue(proto.contains("database {"));
@@ -75,7 +75,7 @@ class ProtoSerializer_Test {
var config = new LinkedHashMap<String, Object>();
config.put("server", server);
- String proto = ProtoSerializer.DEFAULT.serialize(config);
+ String proto = PrototextSerializer.DEFAULT.serialize(config);
assertNotNull(proto);
assertTrue(proto.contains("server {"));
assertTrue(proto.contains("ssl {"));
@@ -87,7 +87,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("tags", List.of("a", "b", "c"));
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("tags"));
assertTrue(proto.contains("a") && proto.contains("b") && proto.contains("c"));
@@ -98,7 +98,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("ports", List.of(8080, 8443, 9090));
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("ports"));
assertTrue(proto.contains("8080"));
@@ -115,7 +115,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("servers", List.of(a, b));
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("servers"));
assertTrue(proto.contains("alpha") && proto.contains("beta"));
@@ -126,7 +126,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("env", Map.of("PATH", "/usr/bin", "HOME", "/home/user"));
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("env {"));
assertTrue(proto.contains("PATH") || proto.contains("HOME"));
@@ -139,7 +139,7 @@ class ProtoSerializer_Test {
m.put("b", null);
m.put("c", 1);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("a:"));
assertTrue(proto.contains("c:"));
@@ -152,7 +152,7 @@ class ProtoSerializer_Test {
m.put("t", true);
m.put("f", false);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertTrue(proto.contains("true"));
assertTrue(proto.contains("false"));
}
@@ -164,7 +164,7 @@ class ProtoSerializer_Test {
m.put("inf", Double.POSITIVE_INFINITY);
m.put("nan", Double.NaN);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("3.14") || proto.contains("3.14"));
assertTrue(proto.contains("inf"));
@@ -176,7 +176,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("s", "a\nb\tc\\d\"e");
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("\\n") || proto.contains("\\\\"));
}
@@ -186,7 +186,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("level", LogLevel.WARN);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertTrue(proto.contains("WARN"));
assertFalse(proto.contains("\"WARN\""));
}
@@ -195,7 +195,7 @@ class ProtoSerializer_Test {
void a13_emptyBean() {
var m = new LinkedHashMap<String, Object>();
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.trim().isEmpty() || proto.equals(""));
}
@@ -205,7 +205,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("tags", List.of());
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertTrue(proto.contains("tags") && proto.contains("[]"));
}
@@ -216,7 +216,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("inner", inner);
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertTrue(proto.contains("inner {"));
assertFalse(proto.contains("inner: {"));
}
@@ -228,14 +228,14 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("inner", inner);
- String proto = ProtoSerializer.DEFAULT_READABLE.serialize(m);
+ String proto = PrototextSerializer.DEFAULT_READABLE.serialize(m);
assertTrue(proto.contains("\n") || proto.contains("inner"));
}
@Test
void a18_addBeanTypesAndRootType() {
var m = JsonMap.of("name", "test");
- var serializer = ProtoSerializer.create().addBeanTypes().addRootType().build();
+ var serializer = PrototextSerializer.create().addBeanTypes().addRootType().build();
String proto = serializer.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("name"));
@@ -247,7 +247,7 @@ class ProtoSerializer_Test {
var m = new LinkedHashMap<String, Object>();
m.put("data", new byte[] { 0x0a, 0x05 });
- String proto = ProtoSerializer.DEFAULT.serialize(m);
+ String proto = PrototextSerializer.DEFAULT.serialize(m);
assertNotNull(proto);
assertTrue(proto.contains("data:"));
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoTokenizer_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextTokenizer_Test.java
similarity index 68%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoTokenizer_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextTokenizer_Test.java
index db3b07a111..150af82fa5 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/proto/ProtoTokenizer_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/prototext/PrototextTokenizer_Test.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.apache.juneau.marshall.proto;
+package org.apache.juneau.marshall.prototext;
import static org.junit.jupiter.api.Assertions.*;
@@ -23,161 +23,161 @@ import org.apache.juneau.marshall.parser.*;
import org.junit.jupiter.api.*;
/**
- * Tests for {@link ProtoTokenizer} behavior, exercised through {@link ProtoParser}.
+ * Tests for {@link PrototextTokenizer} behavior, exercised through {@link PrototextParser}.
*/
-class ProtoTokenizer_Test {
+class PrototextTokenizer_Test {
@Test
void a01_bareIdentifier() {
- var a = ProtoParser.DEFAULT.parse("field_name: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("field_name: 1", JsonMap.class);
assertEquals(1L, a.get("field_name"));
- var b = ProtoParser.DEFAULT.parse("_private: 2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("_private: 2", JsonMap.class);
assertEquals(2L, b.get("_private"));
- var c = ProtoParser.DEFAULT.parse("camelCase: 3", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("camelCase: 3", JsonMap.class);
assertEquals(3L, c.get("camelCase"));
}
@Test
void a02_quotedString() {
- var a = ProtoParser.DEFAULT.parse("s: \"hello\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"hello\"", JsonMap.class);
assertEquals("hello", a.get("s"));
- var b = ProtoParser.DEFAULT.parse("s: 'world'", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: 'world'", JsonMap.class);
assertEquals("world", b.get("s"));
}
@Test
void a03_multiPartString() {
- var a = ProtoParser.DEFAULT.parse("s: \"hello\" \" world\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"hello\" \" world\"", JsonMap.class);
assertEquals("hello world", a.get("s"));
}
@Test
void a04_decimalInteger() {
- var a = ProtoParser.DEFAULT.parse("n: 42", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: 42", JsonMap.class);
assertEquals(42L, a.get("n"));
- var b = ProtoParser.DEFAULT.parse("n: -17", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("n: -17", JsonMap.class);
assertEquals(-17L, b.get("n"));
- var c = ProtoParser.DEFAULT.parse("n: +99", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("n: +99", JsonMap.class);
assertEquals(99L, c.get("n"));
}
@Test
void a05_hexInteger() {
- var a = ProtoParser.DEFAULT.parse("n: 0xDEAD", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: 0xDEAD", JsonMap.class);
assertEquals(0xDEADL, a.get("n"));
- var b = ProtoParser.DEFAULT.parse("n: 0xFF", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("n: 0xFF", JsonMap.class);
assertEquals(255L, b.get("n"));
}
@Test
void a06_octalInteger() {
- var a = ProtoParser.DEFAULT.parse("n: 0755", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: 0755", JsonMap.class);
assertEquals(0755L, a.get("n"));
- var b = ProtoParser.DEFAULT.parse("n: 0123", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("n: 0123", JsonMap.class);
assertEquals(83L, b.get("n"));
}
@Test
void a07_floatLiteral() {
- var a = ProtoParser.DEFAULT.parse("x: 3.14", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 3.14", JsonMap.class);
assertEquals(3.14, a.get("x"));
- var b = ProtoParser.DEFAULT.parse("x: 1e06", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 1e06", JsonMap.class);
assertEquals(1e6, ((Number) b.get("x")).doubleValue(), 1e-6);
- var c = ProtoParser.DEFAULT.parse("x: 10f", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("x: 10f", JsonMap.class);
assertEquals(10.0, ((Number) c.get("x")).doubleValue(), 1e-6);
}
@Test
void a08_specialFloats() {
- var a = ProtoParser.DEFAULT.parse("x: inf", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: inf", JsonMap.class);
assertEquals(Double.POSITIVE_INFINITY, a.get("x"));
- var b = ProtoParser.DEFAULT.parse("x: -inf", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: -inf", JsonMap.class);
assertEquals(Double.NEGATIVE_INFINITY, b.get("x"));
- var c = ProtoParser.DEFAULT.parse("x: nan", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("x: nan", JsonMap.class);
assertTrue(Double.isNaN(((Number) c.get("x")).doubleValue()));
}
@Test
void a09_booleans() {
- var a = ProtoParser.DEFAULT.parse("b: true", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("b: true", JsonMap.class);
assertEquals(true, a.get("b"));
- var b = ProtoParser.DEFAULT.parse("b: false", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("b: false", JsonMap.class);
assertEquals(false, b.get("b"));
}
@Test
void a10_comments() {
- var a = ProtoParser.DEFAULT.parse("# comment\nname: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("# comment\nname: 1", JsonMap.class);
assertEquals(1L, a.get("name"));
- var b = ProtoParser.DEFAULT.parse("name: 1 # trailing comment", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("name: 1 # trailing comment", JsonMap.class);
assertEquals(1L, b.get("name"));
}
@Test
void a11_structuralTokens() {
- var a = ProtoParser.DEFAULT.parse("m { k: 1 }", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("m { k: 1 }", JsonMap.class);
var m = a.getMap("m");
assertNotNull(m);
assertEquals(1L, m.get("k"));
- var b = ProtoParser.DEFAULT.parse("arr: [1, 2]", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("arr: [1, 2]", JsonMap.class);
var arr = b.getList("arr");
assertNotNull(arr);
assertEquals(2, arr.size());
- var c = ProtoParser.DEFAULT.parse("a: 1; b: 2", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("a: 1; b: 2", JsonMap.class);
assertEquals(1L, c.get("a"));
assertEquals(2L, c.get("b"));
- var d = ProtoParser.DEFAULT.parse("a: 1, b: 2", JsonMap.class);
+ var d = PrototextParser.DEFAULT.parse("a: 1, b: 2", JsonMap.class);
assertEquals(1L, d.get("a"));
assertEquals(2L, d.get("b"));
}
@Test
void a12_stringEscapes() {
- var a = ProtoParser.DEFAULT.parse("s: \"\\n\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\n\"", JsonMap.class);
assertEquals("\n", a.get("s"));
- var b = ProtoParser.DEFAULT.parse("s: \"\\t\"", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: \"\\t\"", JsonMap.class);
assertEquals("\t", b.get("s"));
- var c = ProtoParser.DEFAULT.parse("s: \"\\\\\"", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("s: \"\\\\\"", JsonMap.class);
assertEquals("\\", c.get("s"));
- var d = ProtoParser.DEFAULT.parse("s: \"\\\"\"", JsonMap.class);
+ var d = PrototextParser.DEFAULT.parse("s: \"\\\"\"", JsonMap.class);
assertEquals("\"", d.get("s"));
}
@Test
void a13_edgeCaseNumberIdent() {
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("n: 10bar", JsonMap.class));
+ PrototextParser.DEFAULT.parse("n: 10bar", JsonMap.class));
}
@Test
void a14_whitespaceHandling() {
- var a = ProtoParser.DEFAULT.parse(" name : 42 ", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse(" name : 42 ", JsonMap.class);
assertEquals(42L, a.get("name"));
- var b = ProtoParser.DEFAULT.parse("a: 1\nb: 2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("a: 1\nb: 2", JsonMap.class);
assertEquals(1L, b.get("a"));
assertEquals(2L, b.get("b"));
- var c = ProtoParser.DEFAULT.parse("a: 1\r\nb: 2", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("a: 1\r\nb: 2", JsonMap.class);
assertEquals(1L, c.get("a"));
assertEquals(2L, c.get("b"));
}
@@ -186,224 +186,224 @@ class ProtoTokenizer_Test {
// Direct tokenizer tests for paths missed via the parser-only route.
//------------------------------------------------------------------------------------------------------------------
- private static ProtoTokenizer tok(String s) {
- return new ProtoTokenizer(new java.io.StringReader(s));
+ private static PrototextTokenizer tok(String s) {
+ return new PrototextTokenizer(new java.io.StringReader(s));
}
@Test void b01_nullReaderInit() throws Exception {
// Hits the null-reader branch in constructor (line 58).
- var t = new ProtoTokenizer(null);
- assertEquals(ProtoToken.TokenType.EOF, t.peek().type());
+ var t = new PrototextTokenizer(null);
+ assertEquals(PrototextToken.TokenType.EOF, t.peek().type());
}
@Test void b02_commentTerminatedByCRLF() {
// Hits `\r\n` after `#` comment (lines 108-109).
- var a = ProtoParser.DEFAULT.parse("# c1\r\nname: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("# c1\r\nname: 1", JsonMap.class);
assertEquals(1L, a.get("name"));
}
@Test void b03_commentTerminatedByEOF() {
// Hits the EOF-terminator branch in skipWhitespaceAndComments (c < 0 in inner loop).
- var a = ProtoParser.DEFAULT.parse("name: 1\n# trailing eof", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("name: 1\n# trailing eof", JsonMap.class);
assertEquals(1L, a.get("name"));
}
@Test void b04_negativeHex() {
// Hits the neg-hex branch (line 230).
- var a = ProtoParser.DEFAULT.parse("n: -0xFF", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: -0xFF", JsonMap.class);
assertEquals(-255L, a.get("n"));
}
@Test void b05_negativeOctal() {
// Hits the neg-octal branch (line 234).
- var a = ProtoParser.DEFAULT.parse("n: -0755", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: -0755", JsonMap.class);
assertEquals(-0755L, a.get("n"));
}
@Test void b06_zeroFloat() {
// Hits the leading-0 with float-suffix branch (lines 236-238).
- var a = ProtoParser.DEFAULT.parse("x: 0.5", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 0.5", JsonMap.class);
assertEquals(0.5, ((Number) a.get("x")).doubleValue(), 1e-12);
- var b = ProtoParser.DEFAULT.parse("x: 0e2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 0e2", JsonMap.class);
assertEquals(0.0, ((Number) b.get("x")).doubleValue(), 1e-12);
- var c = ProtoParser.DEFAULT.parse("x: 0f", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("x: 0f", JsonMap.class);
assertEquals(0.0, ((Number) c.get("x")).doubleValue(), 1e-12);
}
@Test void b07_zeroBare() {
// Hits the bare-0 returning DEC_INT(0) branch (line 240).
- var a = ProtoParser.DEFAULT.parse("n: 0", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("n: 0", JsonMap.class);
assertEquals(0L, a.get("n"));
}
@Test void b08_dotPrefixFloat() {
// Hits the `.5`-style leading-dot float branch (line 243).
- var a = ProtoParser.DEFAULT.parse("x: .5", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: .5", JsonMap.class);
assertEquals(0.5, ((Number) a.get("x")).doubleValue(), 1e-12);
- var b = ProtoParser.DEFAULT.parse("x: -.25", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: -.25", JsonMap.class);
assertEquals(-0.25, ((Number) b.get("x")).doubleValue(), 1e-12);
}
@Test void b09_floatWithUnderscores() {
// Hits underscore handling in readDecimalOrFloat (lines 280-292).
- var a = ProtoParser.DEFAULT.parse("x: 1_000.5", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 1_000.5", JsonMap.class);
assertEquals(1000.5, ((Number) a.get("x")).doubleValue(), 1e-9);
- var b = ProtoParser.DEFAULT.parse("x: 1.5_5", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 1.5_5", JsonMap.class);
assertEquals(1.55, ((Number) b.get("x")).doubleValue(), 1e-9);
}
@Test void b10_floatExponent_signed() {
// Hits the e+/e- branch in readDecimalOrFloat (lines 297-298).
- var a = ProtoParser.DEFAULT.parse("x: 1.5e+2", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 1.5e+2", JsonMap.class);
assertEquals(150.0, ((Number) a.get("x")).doubleValue(), 1e-9);
- var b = ProtoParser.DEFAULT.parse("x: 1.5e-2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 1.5e-2", JsonMap.class);
assertEquals(0.015, ((Number) b.get("x")).doubleValue(), 1e-9);
}
@Test void b11_floatExponentWithUnderscores() {
// Hits underscore handling in exponent loop (lines 299-302).
- var a = ProtoParser.DEFAULT.parse("x: 1e1_0", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 1e1_0", JsonMap.class);
assertEquals(1e10, ((Number) a.get("x")).doubleValue(), 1e-3);
}
@Test void b12_floatWithFSuffixOnInt() {
// Hits the `f` after raw int branch in readDecimalOrFloat (line 315-316).
- var a = ProtoParser.DEFAULT.parse("x: 5f", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 5f", JsonMap.class);
assertEquals(5.0, ((Number) a.get("x")).doubleValue(), 1e-12);
- var b = ProtoParser.DEFAULT.parse("x: -5f", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: -5f", JsonMap.class);
assertEquals(-5.0, ((Number) b.get("x")).doubleValue(), 1e-12);
}
@Test void b13_specialFloat_negInf() {
// Hits the special-float-with-neg branch (line 347).
- var a = ProtoParser.DEFAULT.parse("x: -infinity", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: -infinity", JsonMap.class);
assertEquals(Double.NEGATIVE_INFINITY, a.get("x"));
}
@Test void b14_specialFloatNanIdentifier() {
// IDENT path returning name 'nano_seconds' (or anything starting with n + non-special).
// readSpecialFloatOrIdent must yield IDENT when not 'nan'/'inf'/'infinity' (line 352).
- var a = ProtoParser.DEFAULT.parse("nan: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("nan: 1", JsonMap.class);
assertEquals(1L, a.get("nan"));
- var b = ProtoParser.DEFAULT.parse("infrastructure: 2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("infrastructure: 2", JsonMap.class);
assertEquals(2L, b.get("infrastructure"));
}
@Test void b15_floatLiteral_underscores() {
// Hits readFloatLiteral underscore-skip code paths (lines 373-377, 383-387).
- var a = ProtoParser.DEFAULT.parse("x: 0.5_5", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 0.5_5", JsonMap.class);
assertEquals(0.55, ((Number) a.get("x")).doubleValue(), 1e-9);
- var b = ProtoParser.DEFAULT.parse("x: 0.5e1_0", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 0.5e1_0", JsonMap.class);
assertEquals(0.5e10, ((Number) b.get("x")).doubleValue(), 1e-3);
}
@Test void b16_floatLiteral_signedExponent() {
// readFloatLiteral signed-exponent branch (lines 381-382).
- var a = ProtoParser.DEFAULT.parse("x: 0.5e+2", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 0.5e+2", JsonMap.class);
assertEquals(50.0, ((Number) a.get("x")).doubleValue(), 1e-9);
- var b = ProtoParser.DEFAULT.parse("x: 0.5e-2", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("x: 0.5e-2", JsonMap.class);
assertEquals(0.005, ((Number) b.get("x")).doubleValue(), 1e-9);
}
@Test void b17_floatLiteral_fSuffix() {
// readFloatLiteral `f`/`F` suffix branch (lines 389-390).
- var a = ProtoParser.DEFAULT.parse("x: 0.5f", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: 0.5f", JsonMap.class);
assertEquals(0.5, ((Number) a.get("x")).doubleValue(), 1e-12);
}
@Test void b18_stringEscape_a_b_f_v() {
// Hits processEscape cases 'a','b','f','v' (lines 450-456).
- var a = ProtoParser.DEFAULT.parse("s: \"\\a\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\a\"", JsonMap.class);
assertEquals("", a.get("s"));
- var b = ProtoParser.DEFAULT.parse("s: \"\\b\"", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: \"\\b\"", JsonMap.class);
assertEquals("\b", b.get("s"));
- var c = ProtoParser.DEFAULT.parse("s: \"\\f\"", JsonMap.class);
+ var c = PrototextParser.DEFAULT.parse("s: \"\\f\"", JsonMap.class);
assertEquals("\f", c.get("s"));
- var d = ProtoParser.DEFAULT.parse("s: \"\\v\"", JsonMap.class);
+ var d = PrototextParser.DEFAULT.parse("s: \"\\v\"", JsonMap.class);
assertEquals("", d.get("s"));
}
@Test void b19_stringEscape_r() {
- var a = ProtoParser.DEFAULT.parse("s: \"\\r\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\r\"", JsonMap.class);
assertEquals("\r", a.get("s"));
}
@Test void b20_stringEscape_questionAndQuote() {
// Hits processEscape cases '?', '\'', '"' (lines 457-460).
- var a = ProtoParser.DEFAULT.parse("s: \"\\?\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\?\"", JsonMap.class);
assertEquals("?", a.get("s"));
- var b = ProtoParser.DEFAULT.parse("s: \"\\'\"", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: \"\\'\"", JsonMap.class);
assertEquals("'", b.get("s"));
}
@Test void b21_stringEscape_hex() {
// Hits processEscape '\\x'/'\\X' (line 461) and readHexEscape.
- var a = ProtoParser.DEFAULT.parse("s: \"\\x41\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\x41\"", JsonMap.class);
assertEquals("A", a.get("s"));
- var b = ProtoParser.DEFAULT.parse("s: \"\\X41\"", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: \"\\X41\"", JsonMap.class);
assertEquals("A", b.get("s"));
}
@Test void b22_stringEscape_octal() {
// Hits processEscape octal-digit branch (lines 462-465) and readOctalEscape.
// Octal 101 = decimal 65 = 'A'.
- var a = ProtoParser.DEFAULT.parse("s: \"\\101\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\101\"", JsonMap.class);
assertEquals("A", a.get("s"));
// Octal 7 (single digit) — terminator restricts the loop to one digit.
- var b = ProtoParser.DEFAULT.parse("s: \"\\7\"", JsonMap.class);
+ var b = PrototextParser.DEFAULT.parse("s: \"\\7\"", JsonMap.class);
assertEquals("", b.get("s"));
}
@Test void b23_stringEscape_unicode4() {
// Hits processEscape backslash-u + readUnicodeEscape(4) (line 466).
- var a = ProtoParser.DEFAULT.parse("s: \"\\u0041\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\u0041\"", JsonMap.class);
assertEquals("A", a.get("s"));
}
@Test void b24_stringEscape_unicode8() {
// Hits processEscape backslash-U + readUnicodeEscape(8) (line 467).
- var a = ProtoParser.DEFAULT.parse("s: \"\\U00000041\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\U00000041\"", JsonMap.class);
assertEquals("A", a.get("s"));
}
@Test void b25_stringEscape_invalid() {
// Hits the default error-path in processEscape (line 468).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"\\q\"", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"\\q\"", JsonMap.class));
}
@Test void b26_invalidHexEscape() {
// Hits the empty-hex error in readHexEscape (line 477).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"\\x\"", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"\\x\"", JsonMap.class));
}
@Test void b27_invalidUnicodeEscape() {
// Hits the invalid-unicode-char error in readUnicodeEscape (line 495).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"\\u00ZZ\"", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"\\u00ZZ\"", JsonMap.class));
}
@Test void b28_unterminatedString() {
// Hits the EOF-during-string error (line 444).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"unterminated", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"unterminated", JsonMap.class));
}
@Test void b29_singleQuotedStringWithEscape() {
// Exercises readSingleQuotedString + readStringContent.
- var a = ProtoParser.DEFAULT.parse("s: 'hi\\nbye'", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: 'hi\\nbye'", JsonMap.class);
assertEquals("hi\nbye", a.get("s"));
}
@@ -507,32 +507,32 @@ class ProtoTokenizer_Test {
@Test void b43_invalidEscape_endOfStream() {
// Hits the unterminated-escape path (escape char EOF).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"\\", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"\\", JsonMap.class));
}
@Test void b44_integerOverflow() {
// Hits the integer-overflow error in readDecimalOrFloat (line 331).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("n: 99999999999999999999999", JsonMap.class));
+ PrototextParser.DEFAULT.parse("n: 99999999999999999999999", JsonMap.class));
}
@Test void b45_hexOverflow() {
// Hits the integer-overflow error in readHexInteger (line 263).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("n: 0xFFFFFFFFFFFFFFFFFF", JsonMap.class));
+ PrototextParser.DEFAULT.parse("n: 0xFFFFFFFFFFFFFFFFFF", JsonMap.class));
}
@Test void b46_emptyHexInteger() {
// Hits the empty-hex error in readHexInteger (line 259).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("n: 0x", JsonMap.class));
+ PrototextParser.DEFAULT.parse("n: 0x", JsonMap.class));
}
@Test void b47_unicodeInvalidCodePoint() {
// Hits the invalid-codepoint error in readUnicodeEscape — \U with a non-codepoint.
// 0xFFFFFFFF is not a valid codepoint per Character.isValidCodePoint.
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("s: \"\\UFFFFFFFF\"", JsonMap.class));
+ PrototextParser.DEFAULT.parse("s: \"\\UFFFFFFFF\"", JsonMap.class));
}
@Test void b48_invalidOctalEscape() {
@@ -540,7 +540,7 @@ class ProtoTokenizer_Test {
// path when the first digit is 0-7, so triggering the empty error directly requires a
// non-octal first digit. The empty error path is unreachable from processEscape; to cover
// the success case for max-3-digit octal we use \\377 = decimal 255 = ÿ.
- var a = ProtoParser.DEFAULT.parse("s: \"\\377\"", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("s: \"\\377\"", JsonMap.class);
assertEquals("ÿ", a.get("s"));
}
@@ -549,35 +549,35 @@ class ProtoTokenizer_Test {
// Construct a literal like "1.2.3" which the lexer reads as 1.2 followed by .3 — but that
// won't error here. Instead use a raw underscore-only mantissa.
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("x: 1.0e", JsonMap.class));
+ PrototextParser.DEFAULT.parse("x: 1.0e", JsonMap.class));
}
@Test void b50_specialFloatLookaheadIdent() {
// The startsSpecialFloatLiteral lookahead returns false for `infrastructure` because
// the assembled token isn't a special-float; this exercises the unread/restore path
// (lines 203-209).
- var a = ProtoParser.DEFAULT.parse("infrastructure: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("infrastructure: 1", JsonMap.class);
assertEquals(1L, a.get("infrastructure"));
}
@Test void b51_eofToken() throws Exception {
// Hits the EOF lex branch (line 132) — empty input yields EOF.
var t = tok("");
- assertEquals(ProtoToken.TokenType.EOF, t.peek().type());
+ assertEquals(PrototextToken.TokenType.EOF, t.peek().type());
}
@Test void b52_structuralPunctuation() throws Exception {
// Hits each of the punctuation switch arms in lex (lines 135-143).
var t = tok("{}<>[]:,;");
- assertEquals(ProtoToken.TokenType.LBRACE, t.read().type());
- assertEquals(ProtoToken.TokenType.RBRACE, t.read().type());
- assertEquals(ProtoToken.TokenType.LANGLE, t.read().type());
- assertEquals(ProtoToken.TokenType.RANGLE, t.read().type());
- assertEquals(ProtoToken.TokenType.LBRACKET, t.read().type());
- assertEquals(ProtoToken.TokenType.RBRACKET, t.read().type());
- assertEquals(ProtoToken.TokenType.COLON, t.read().type());
- assertEquals(ProtoToken.TokenType.COMMA, t.read().type());
- assertEquals(ProtoToken.TokenType.SEMICOLON, t.read().type());
+ assertEquals(PrototextToken.TokenType.LBRACE, t.read().type());
+ assertEquals(PrototextToken.TokenType.RBRACE, t.read().type());
+ assertEquals(PrototextToken.TokenType.LANGLE, t.read().type());
+ assertEquals(PrototextToken.TokenType.RANGLE, t.read().type());
+ assertEquals(PrototextToken.TokenType.LBRACKET, t.read().type());
+ assertEquals(PrototextToken.TokenType.RBRACKET, t.read().type());
+ assertEquals(PrototextToken.TokenType.COLON, t.read().type());
+ assertEquals(PrototextToken.TokenType.COMMA, t.read().type());
+ assertEquals(PrototextToken.TokenType.SEMICOLON, t.read().type());
}
@Test void b53_unexpectedCharacter() {
@@ -588,7 +588,7 @@ class ProtoTokenizer_Test {
@Test void b54_skipMultipleWhitespaceTypes() {
// Hits each whitespace-type branch in skipWhitespaceAndComments (line 100): space/tab/newline/CR/0x0B/0x0C.
- var a = ProtoParser.DEFAULT.parse(" \t\n\rname: 1", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse(" \t\n\rname: 1", JsonMap.class);
assertEquals(1L, a.get("name"));
}
@@ -596,18 +596,18 @@ class ProtoTokenizer_Test {
// Hits the c<0 branch of unread (line 91) — no pushback occurs.
var t = tok("");
t.unread(-1);
- assertEquals(ProtoToken.TokenType.EOF, t.peek().type());
+ assertEquals(PrototextToken.TokenType.EOF, t.peek().type());
}
@Test void b56_signedPlusFloat() {
// `+0.5` exercises the c == '+' branch in lexNumber (lines 220-222).
- var a = ProtoParser.DEFAULT.parse("x: +0.5", JsonMap.class);
+ var a = PrototextParser.DEFAULT.parse("x: +0.5", JsonMap.class);
assertEquals(0.5, ((Number) a.get("x")).doubleValue(), 1e-12);
}
@Test void b57_octalInvalid() {
// Hits readOctalInteger overflow path (line 274).
assertThrows(ParseException.class, () ->
- ProtoParser.DEFAULT.parse("n: 0777777777777777777777777", JsonMap.class));
+ PrototextParser.DEFAULT.parse("n: 0777777777777777777777777", JsonMap.class));
}
}
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/FormatStreamingCapability_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/FormatStreamingCapability_Test.java
index ea5709e9d1..0578a09523 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/FormatStreamingCapability_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/FormatStreamingCapability_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.oapi.*;
import org.apache.juneau.marshall.parquet.*;
import org.apache.juneau.marshall.parser.*;
import org.apache.juneau.marshall.plaintext.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.sse.*;
import org.apache.juneau.marshall.toml.*;
@@ -61,7 +61,7 @@ class FormatStreamingCapability_Test extends TestBase {
return List.of(
JsonParser.DEFAULT, Json5Parser.DEFAULT, JsonlParser.DEFAULT,
CborParser.DEFAULT, MsgPackParser.DEFAULT, BsonParser.DEFAULT,
- ProtoParser.DEFAULT, ParquetParser.DEFAULT, YamlParser.DEFAULT,
+ PrototextParser.DEFAULT, ParquetParser.DEFAULT, YamlParser.DEFAULT,
TomlParser.DEFAULT, HoconParser.DEFAULT, HjsonParser.DEFAULT,
CsvParser.DEFAULT, PlainTextParser.DEFAULT, MarkdownParser.DEFAULT,
IniParser.DEFAULT, UonParser.DEFAULT, OpenApiParser.DEFAULT,
@@ -73,7 +73,7 @@ class FormatStreamingCapability_Test extends TestBase {
return List.of(
JsonSerializer.DEFAULT, Json5Serializer.DEFAULT, JsonlSerializer.DEFAULT,
CborSerializer.DEFAULT, MsgPackSerializer.DEFAULT, BsonSerializer.DEFAULT,
- ProtoSerializer.DEFAULT, ParquetSerializer.DEFAULT, YamlSerializer.DEFAULT,
+ PrototextSerializer.DEFAULT, ParquetSerializer.DEFAULT, YamlSerializer.DEFAULT,
TomlSerializer.DEFAULT, HoconSerializer.DEFAULT, HjsonSerializer.DEFAULT,
CsvSerializer.DEFAULT, PlainTextSerializer.DEFAULT, MarkdownSerializer.DEFAULT,
IniSerializer.DEFAULT, UonSerializer.DEFAULT, OpenApiSerializer.DEFAULT,
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/RecordStream_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/RecordStream_Test.java
index dcd92f8009..3a5841e102 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/RecordStream_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/stream/RecordStream_Test.java
@@ -36,7 +36,7 @@ import org.apache.juneau.marshall.oapi.*;
import org.apache.juneau.marshall.parquet.*;
import org.apache.juneau.marshall.parser.*;
import org.apache.juneau.marshall.plaintext.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.sse.*;
import org.apache.juneau.marshall.toml.*;
@@ -88,7 +88,7 @@ class RecordStream_Test extends TestBase {
MSGPACK (org.apache.juneau.marshall.msgpack.MsgPackParser.DEFAULT,
org.apache.juneau.marshall.msgpack.MsgPackSerializer.DEFAULT, Mode.BINARY),
BSON (BsonParser.DEFAULT, BsonSerializer.DEFAULT, Mode.BINARY),
- PROTO (ProtoParser.DEFAULT, ProtoSerializer.DEFAULT, Mode.BINARY, Skip.PROTO_LIMITATIONS),
+ PROTO (PrototextParser.DEFAULT, PrototextSerializer.DEFAULT, Mode.BINARY, Skip.PROTO_LIMITATIONS),
PARQUET (ParquetParser.DEFAULT, ParquetSerializer.DEFAULT, Mode.BINARY, Skip.PARQUET_LIMITATIONS),
YAML (YamlParser.DEFAULT, YamlSerializer.DEFAULT),
TOML (TomlParser.DEFAULT, TomlSerializer.DEFAULT, Skip.NESTED_ROOT_REQUIRED, Skip.LIMITED_BEAN_BINDING),
@@ -148,7 +148,7 @@ class RecordStream_Test extends TestBase {
NESTED_ROOT_REQUIRED,
/** JSONL produces multiple records on the wire; we test it via separate multi-record assertions. */
MULTI_RECORD,
- /** Proto's wire format requires beans with explicit field tags; many shapes don't round-trip. */
+ /** Prototext's wire format requires beans with explicit field tags; many shapes don't round-trip. */
PROTO_LIMITATIONS,
/** Parquet's row-group layout doesn't roundtrip arbitrary nested shapes for single-bean payloads. */
PARQUET_LIMITATIONS,
@@ -247,7 +247,7 @@ class RecordStream_Test extends TestBase {
assumeFalse(fmt.has(Skip.MARKDOWN_FRAGMENT_ONLY), "Markdown fragments don't round-trip arbitrary scalars");
assumeFalse(fmt.has(Skip.NESTED_ROOT_REQUIRED), "Format requires a bean/map root");
assumeFalse(fmt.has(Skip.CSV_FLAT_TABULAR_ONLY), "CSV requires a tabular root");
- assumeFalse(fmt.has(Skip.PROTO_LIMITATIONS), "Proto requires bean schema");
+ assumeFalse(fmt.has(Skip.PROTO_LIMITATIONS), "Prototext requires bean schema");
assumeFalse(fmt.has(Skip.PARQUET_LIMITATIONS), "Parquet requires row-shaped data");
assumeFalse(fmt.has(Skip.URLENC_LIMITATIONS), "UrlEncoding requires top-level map shape");
assumeFalse(fmt.has(Skip.MULTI_RECORD), "JSONL multi-record covered separately");
@@ -268,7 +268,7 @@ class RecordStream_Test extends TestBase {
assumeFalse(fmt.has(Skip.PLAINTEXT_TOSTRING_ONLY), "PlainText only round-trips strings");
assumeFalse(fmt.has(Skip.MULTI_RECORD), "JSONL multi-record covered separately");
assumeFalse(fmt.has(Skip.WRITER_ONLY_OUTPUT_ONLY), "writer-only no roundtrip");
- assumeFalse(fmt.has(Skip.PROTO_LIMITATIONS), "Proto requires schema annotations");
+ assumeFalse(fmt.has(Skip.PROTO_LIMITATIONS), "Prototext requires schema annotations");
assumeFalse(fmt.has(Skip.PARQUET_LIMITATIONS), "Parquet requires List wrapper");
assumeFalse(fmt.has(Skip.URLENC_LIMITATIONS), "UrlEncoding requires top-level map shape");
assumeFalse(fmt.has(Skip.MARKDOWN_FRAGMENT_ONLY), "Markdown serializer/parser asymmetric for single-bean key/value table");
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
index c4b9a0d4fc..bf2850aaff 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigDecimal_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -71,7 +71,7 @@ import org.junit.jupiter.params.provider.*;
* {@link BigNumberFormat#format(BigDecimal, BigNumberFormat) BigNumberFormat.format(BigDecimal,…)} contract,
* any non-zero-scale {@link BigDecimal} (anything with a fractional part) is forced to {@link BigNumberFormat#STRING}
* regardless of magnitude. Zero-scale {@link BigDecimal} values use the integer JS-safe bound. Binary serializers
- * (MsgPack / CBOR / Proto / BSON / Parquet) bypass the format dispatch and receive the native {@link BigDecimal};
+ * (MsgPack / CBOR / Prototext / BSON / Parquet) bypass the format dispatch and receive the native {@link BigDecimal};
* they downcast to {@code double} or equivalent and may lose precision past 64-bit float capacity. The matrix
* below stays inside double-precision-safe scales / magnitudes so binary round-trips remain lossless.
*/
@@ -194,9 +194,9 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
.parser(MarkdownParser.create().bigNumberFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
- .parser(ProtoParser.create().bigNumberFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
+ .parser(PrototextParser.create().bigNumberFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
@@ -277,7 +277,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
* fractional {@link BigDecimal} values to integer on the wire.
*
* <p>
- * Toml and Proto serializer sessions classify any non-{@link Float} / non-{@link Double} {@link Number}
+ * Toml and Prototext serializer sessions classify any non-{@link Float} / non-{@link Double} {@link Number}
* via {@code w.integerValue(((Number)value).longValue())} in their {@code writeValue} dispatch, which
* truncates the fractional part. Under {@link BigNumberFormat#STRING} / {@link BigNumberFormat#AUTO}
* the swap returns a {@link String} for the bean-property path, so the {@code Number} branch isn't
@@ -292,7 +292,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
*/
private static boolean truncatesFractionalBigDecimal(RoundTrip_Tester t, BigNumberFormat fmt, boolean isTopLevel) {
var s = t.getSerializer();
- var affected = s instanceof org.apache.juneau.marshall.toml.TomlSerializer || s instanceof org.apache.juneau.marshall.proto.ProtoSerializer;
+ var affected = s instanceof org.apache.juneau.marshall.toml.TomlSerializer || s instanceof org.apache.juneau.marshall.prototext.PrototextSerializer;
if (!affected)
return false;
if (isTopLevel)
@@ -441,7 +441,7 @@ class BigNumberFormat_BigDecimal_RoundTrip_Test extends TestBase {
// standalone BigDecimal value — they assert that the serializer accepts it without throwing.
if (t.isValidationOnly())
return;
- // Top-level raw-value dispatch on Toml/Proto truncates fractional BigDecimal regardless of format
+ // Top-level raw-value dispatch on Toml/Prototext truncates fractional BigDecimal regardless of format
// (the swap install path only applies to bean-property metadata, not standalone-value dispatch).
if (truncatesFractionalBigDecimal(t, fmt, true))
return;
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
index 6b8b8c0536..db80add297 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BigNumberFormat_BigInteger_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -70,7 +70,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link BigNumberFormat} is structurally lossless for {@link BigInteger} on text serializers — every constant
* preserves the full integer value (the choice is just bare-numeric vs quoted-string vs JS-safe hybrid).
- * Binary serializers (MsgPack / CBOR / Proto / BSON) bypass the format dispatch and receive the native
+ * Binary serializers (MsgPack / CBOR / Prototext / BSON) bypass the format dispatch and receive the native
* {@link BigInteger}; the binary format then decides how to encode it natively. Values beyond a 64-bit
* signed integer ({@code ±2^63 − 1}) may lose precision or fail in formats that lack a wide-integer wire type.
*/
@@ -193,9 +193,9 @@ class BigNumberFormat_BigInteger_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
.parser(MarkdownParser.create().bigNumberFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
- .parser(ProtoParser.create().bigNumberFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
+ .parser(PrototextParser.create().bigNumberFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().bigNumberFormat(fmt))
@@ -324,10 +324,10 @@ class BigNumberFormat_BigInteger_RoundTrip_Test extends TestBase {
// Bean with large BigInteger — JS-unsafe-but-long-safe stress (AUTO dispatch + NUMBER/STRING boundary)
//
// <p>
- // Values are pinned within signed 64-bit range so binary serializers (MsgPack / CBOR / BSON / Proto)
+ // Values are pinned within signed 64-bit range so binary serializers (MsgPack / CBOR / BSON / Prototext)
// that bypass {@code BigNumberFormat} dispatch and emit native int64 round-trip cleanly. Values beyond
// {@code Long.MAX_VALUE} are out-of-matrix scope by design: per the {@link BigNumberFormat} class-level
- // "Binary serializers" note, MsgPack / CBOR / Proto / BSON downcast big integers to their widest native
+ // "Binary serializers" note, MsgPack / CBOR / Prototext / BSON downcast big integers to their widest native
// numeric type (int64 / double / decimal128) and lose precision above that ceiling. JCS additionally
// caps at {@code Long.MAX_VALUE} via {@code BigInteger.longValueExact} per RFC 8785. The matrix below
// stays under that ceiling but still exceeds the JavaScript {@code 2^53 − 1} safe-integer limit, which
@@ -346,7 +346,7 @@ class BigNumberFormat_BigInteger_RoundTrip_Test extends TestBase {
void a04_bigIntegerProperty_largeValues(RoundTrip_Tester t, BigNumberFormat fmt) throws Exception {
var x = new A04Bean();
x.longMax = BigInteger.valueOf(Long.MAX_VALUE);
- // Long.MIN_VALUE + 1 instead of Long.MIN_VALUE: the Proto tokenizer parses signed integers by
+ // Long.MIN_VALUE + 1 instead of Long.MIN_VALUE: the Prototext tokenizer parses signed integers by
// tokenising magnitude-first then applying sign, so the literal "-9223372036854775808" overflows on
// the unsigned magnitude side. Long.MIN_VALUE + 1's magnitude == Long.MAX_VALUE which fits.
x.longMinPlusOne = BigInteger.valueOf(Long.MIN_VALUE + 1L);
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
index 0270d615ad..12b9361aea 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BinaryFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -68,7 +68,7 @@ import org.junit.jupiter.params.provider.*;
*
* <p>
* {@link BinaryFormat} only affects text-based serializers per the class-level "Binary serializers" note —
- * BSON / CBOR / MsgPack / Proto / Parquet emit native bytes regardless of the configured constant. The
+ * BSON / CBOR / MsgPack / Prototext / Parquet emit native bytes regardless of the configured constant. The
* variant {@code binarySwap} installed by {@code MarshalledPropertyPostProcessor} respects that by handing
* the raw {@code byte[]} back to {@link org.apache.juneau.marshall.serializer.OutputStreamSerializerSession}
* subtypes instead of the formatted wire string, so bean-property round-trips through binary serializers
@@ -186,9 +186,9 @@ class BinaryFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().binaryFormat(fmt))
.parser(MarkdownParser.create().binaryFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().binaryFormat(fmt))
- .parser(ProtoParser.create().binaryFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().binaryFormat(fmt))
+ .parser(PrototextParser.create().binaryFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().binaryFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
index 83edee9411..4baa2b5030 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/BooleanFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -72,7 +72,7 @@ import org.junit.jupiter.params.provider.*;
*
* <p>
* Per the {@link BooleanFormat} class-level "Binary serializers" note, the binary serializer family
- * (BSON / CBOR / MsgPack / Proto / Parquet) emits a native boolean wire type regardless of the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emits a native boolean wire type regardless of the
* configured constant. The variant {@code booleanSwap} installed by
* {@link org.apache.juneau.marshall.MarshalledPropertyPostProcessor} respects that by returning the raw
* {@link Boolean} to {@link org.apache.juneau.marshall.serializer.OutputStreamSerializerSession} subtypes
@@ -191,9 +191,9 @@ class BooleanFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().booleanFormat(fmt))
.parser(MarkdownParser.create().booleanFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().booleanFormat(fmt))
- .parser(ProtoParser.create().booleanFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().booleanFormat(fmt))
+ .parser(PrototextParser.create().booleanFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().booleanFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CalendarFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CalendarFormat_RoundTrip_Test.java
index 670c18d0b8..9695c93d45 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CalendarFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CalendarFormat_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -193,9 +193,9 @@ class CalendarFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().calendarFormat(fmt))
.parser(MarkdownParser.create().calendarFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().calendarFormat(fmt))
- .parser(ProtoParser.create().calendarFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().calendarFormat(fmt))
+ .parser(PrototextParser.create().calendarFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().calendarFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/ClassFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/ClassFormat_RoundTrip_Test.java
index a5408a0393..dd3b33d7b8 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/ClassFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/ClassFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -187,9 +187,9 @@ class ClassFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().classFormat(fmt))
.parser(MarkdownParser.create().classFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().classFormat(fmt))
- .parser(ProtoParser.create().classFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().classFormat(fmt))
+ .parser(PrototextParser.create().classFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().classFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CurrencyFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CurrencyFormat_RoundTrip_Test.java
index 616a8ab9df..3d2ef62f6c 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CurrencyFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/CurrencyFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -194,9 +194,9 @@ class CurrencyFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().currencyFormat(fmt))
.parser(MarkdownParser.create().currencyFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().currencyFormat(fmt))
- .parser(ProtoParser.create().currencyFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().currencyFormat(fmt))
+ .parser(PrototextParser.create().currencyFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().currencyFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DateFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DateFormat_RoundTrip_Test.java
index cc001738c9..471fae333e 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DateFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DateFormat_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -192,9 +192,9 @@ class DateFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().dateFormat(fmt))
.parser(MarkdownParser.create().dateFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().dateFormat(fmt))
- .parser(ProtoParser.create().dateFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().dateFormat(fmt))
+ .parser(PrototextParser.create().dateFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().dateFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DurationFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DurationFormat_RoundTrip_Test.java
index 5564a1ce4e..771d0b122c 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DurationFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/DurationFormat_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -192,9 +192,9 @@ class DurationFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().durationFormat(fmt))
.parser(MarkdownParser.create().durationFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().durationFormat(fmt))
- .parser(ProtoParser.create().durationFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().durationFormat(fmt))
+ .parser(PrototextParser.create().durationFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().durationFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/EnumFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/EnumFormat_RoundTrip_Test.java
index 36a66ad5ed..8c2b122c4b 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/EnumFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/EnumFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -185,9 +185,9 @@ class EnumFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().enumFormat(fmt))
.parser(MarkdownParser.create().enumFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().enumFormat(fmt))
- .parser(ProtoParser.create().enumFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().enumFormat(fmt))
+ .parser(PrototextParser.create().enumFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().enumFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
index 80b837a58b..d90a5a3cc9 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Double_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
@@ -69,18 +69,18 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link FloatFormat} only controls how non-finite values ({@code NaN}, {@code ±Infinity}) are emitted on
* <b>text-based</b> wire formats; finite values ride the natural bare-numeric token and binary serializers
- * (BSON / CBOR / MsgPack / Proto / Parquet) emit native IEEE-754 regardless of this setting per the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emit native IEEE-754 regardless of this setting per the
* {@link FloatFormat} class-level "Binary serializers" note. The matrix below exercises finite values across
* all five {@link FloatFormat} constants for the standard tests, with a dedicated non-finite test
* ({@link #a04_doubleProperty_nonFinite}) that skips {@link FloatFormat#NaN_AS_ERROR} (throws on swap) and
* canonicalises against the format-specific wire shape via {@link #expectedAfterNonFinite}.
*
* <p>
- * Unlike the {@link Float} sibling, this file has no Proto-skip helper — the Proto text-format tokenizer
+ * Unlike the {@link Float} sibling, this file has no Prototext-skip helper — the Prototext text-format tokenizer
* bugs that forced those skips (Bug #4a — neg-flag discard on the Double return path of
* {@code readDecimalOrFloat}; Bug #4b — {@code 0.x} mis-tokenisation in {@code lexNumber}'s `0`-prefix
* branch) were both fixed before this file landed (see the work item 57 notes). The {@code a04} non-finite
- * test still skips Proto in the {@link Float} sibling because Bug #4c ({@code mightStartNumber}
+ * test still skips Prototext in the {@link Float} sibling because Bug #4c ({@code mightStartNumber}
* {@code nan}/{@code inf} asymmetry) is still open — same predicate carried into this file for the same
* reason.
*/
@@ -203,9 +203,9 @@ class FloatFormat_Double_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
.parser(MarkdownParser.create().floatFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
- .parser(ProtoParser.create().floatFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
+ .parser(PrototextParser.create().floatFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
@@ -251,7 +251,7 @@ class FloatFormat_Double_RoundTrip_Test extends TestBase {
* Returns <jk>true</jk> when {@code t} is wrapped around a binary serializer (any
* {@link OutputStreamSerializer} subtype). Binary serializers emit native IEEE-754 regardless of
* {@link FloatFormat} per the class-level "Binary serializers" note, so non-finite values round-trip
- * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Proto,
+ * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Prototext,
* and the RDF stream variants (RdfThrift / RdfProto).
*/
private static boolean isBinarySerializer(RoundTrip_Tester t) {
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
index acbb33289b..e1d728b1a7 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/FloatFormat_Float_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
@@ -69,7 +69,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link FloatFormat} only controls how non-finite values ({@code NaN}, {@code ±Infinity}) are emitted on
* <b>text-based</b> wire formats; finite values ride the natural bare-numeric token and binary serializers
- * (BSON / CBOR / MsgPack / Proto / Parquet) emit native IEEE-754 regardless of this setting per the
+ * (BSON / CBOR / MsgPack / Prototext / Parquet) emit native IEEE-754 regardless of this setting per the
* {@link FloatFormat} class-level "Binary serializers" note. The matrix below exercises finite values across
* all five {@link FloatFormat} constants for the standard tests, with a dedicated non-finite test
* ({@link #a04_floatProperty_nonFinite}) that skips {@link FloatFormat#NaN_AS_ERROR} (throws on swap) and
@@ -194,9 +194,9 @@ class FloatFormat_Float_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
.parser(MarkdownParser.create().floatFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
- .parser(ProtoParser.create().floatFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
+ .parser(PrototextParser.create().floatFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().floatFormat(fmt))
@@ -242,7 +242,7 @@ class FloatFormat_Float_RoundTrip_Test extends TestBase {
* Returns <jk>true</jk> when {@code t} is wrapped around a binary serializer (any
* {@link OutputStreamSerializer} subtype). Binary serializers emit native IEEE-754 regardless of
* {@link FloatFormat} per the class-level "Binary serializers" note, so non-finite values round-trip
- * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Proto,
+ * natively without going through the format dispatch. Covers MsgPack, CBOR, BSON, Parquet, Prototext,
* and the RDF stream variants (RdfThrift / RdfProto).
*/
private static boolean isBinarySerializer(RoundTrip_Tester t) {
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/LocaleFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/LocaleFormat_RoundTrip_Test.java
index f74aefaa6e..086805ccc6 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/LocaleFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/LocaleFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -199,9 +199,9 @@ class LocaleFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().localeFormat(fmt))
.parser(MarkdownParser.create().localeFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().localeFormat(fmt))
- .parser(ProtoParser.create().localeFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().localeFormat(fmt))
+ .parser(PrototextParser.create().localeFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().localeFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/PeriodFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/PeriodFormat_RoundTrip_Test.java
index 8b76ba30d4..0b93ff1925 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/PeriodFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/PeriodFormat_RoundTrip_Test.java
@@ -39,7 +39,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -191,9 +191,9 @@ class PeriodFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().periodFormat(fmt))
.parser(MarkdownParser.create().periodFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().periodFormat(fmt))
- .parser(ProtoParser.create().periodFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().periodFormat(fmt))
+ .parser(PrototextParser.create().periodFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().periodFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Instant_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Instant_RoundTrip_Test.java
index 8bd7f4ceaf..f67ceee549 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Instant_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Instant_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -190,9 +190,9 @@ class TemporalFormat_Instant_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDateTime_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDateTime_RoundTrip_Test.java
index 27dd9be0a5..a7452b2f61 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDateTime_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDateTime_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -174,9 +174,9 @@ class TemporalFormat_LocalDateTime_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDate_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDate_RoundTrip_Test.java
index 020f12f21f..eadd1558bf 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDate_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalDate_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -179,9 +179,9 @@ class TemporalFormat_LocalDate_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalTime_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalTime_RoundTrip_Test.java
index c95cac829c..060734841f 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalTime_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_LocalTime_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -178,9 +178,9 @@ class TemporalFormat_LocalTime_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_MonthDay_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_MonthDay_RoundTrip_Test.java
index 54b8ad1da5..02584dba58 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_MonthDay_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_MonthDay_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -180,9 +180,9 @@ class TemporalFormat_MonthDay_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetDateTime_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetDateTime_RoundTrip_Test.java
index 994908d576..9dd50ef69d 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetDateTime_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetDateTime_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -177,9 +177,9 @@ class TemporalFormat_OffsetDateTime_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetTime_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetTime_RoundTrip_Test.java
index 3c75c447d6..337dda1e7d 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetTime_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_OffsetTime_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -177,9 +177,9 @@ class TemporalFormat_OffsetTime_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_YearMonth_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_YearMonth_RoundTrip_Test.java
index edab7b7897..312c77427a 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_YearMonth_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_YearMonth_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -179,9 +179,9 @@ class TemporalFormat_YearMonth_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Year_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Year_RoundTrip_Test.java
index 3fa724e1e9..15c53c6f96 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Year_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_Year_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -179,9 +179,9 @@ class TemporalFormat_Year_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_ZonedDateTime_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_ZonedDateTime_RoundTrip_Test.java
index 2645a5cf4c..f073de3cea 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_ZonedDateTime_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TemporalFormat_ZonedDateTime_RoundTrip_Test.java
@@ -40,7 +40,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -177,9 +177,9 @@ class TemporalFormat_ZonedDateTime_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
.parser(MarkdownParser.create().temporalFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
- .parser(ProtoParser.create().temporalFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
+ .parser(PrototextParser.create().temporalFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().temporalFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TimeZoneFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TimeZoneFormat_RoundTrip_Test.java
index a7064fd968..c56f43219e 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TimeZoneFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/TimeZoneFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -181,9 +181,9 @@ class TimeZoneFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().timeZoneFormat(fmt))
.parser(MarkdownParser.create().timeZoneFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().timeZoneFormat(fmt))
- .parser(ProtoParser.create().timeZoneFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().timeZoneFormat(fmt))
+ .parser(PrototextParser.create().timeZoneFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().timeZoneFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
index 08f50ca1a0..0bc485ec96 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshall/transforms/UuidFormat_RoundTrip_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -63,7 +63,7 @@ import org.junit.jupiter.params.provider.*;
* <p>
* {@link UuidFormat} is structurally lossless on text serializers — every constant preserves the full
* 128-bit value (the choice is just hyphenated / compact / URN-prefixed). Binary serializers
- * (BSON / CBOR / MsgPack / Proto) bypass the format dispatch and emit a native 16-byte binary
+ * (BSON / CBOR / MsgPack / Prototext) bypass the format dispatch and emit a native 16-byte binary
* representation; the round-trip is still lossless.
*/
@SuppressWarnings({
@@ -176,9 +176,9 @@ class UuidFormat_RoundTrip_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType().uuidFormat(fmt))
.parser(MarkdownParser.create().uuidFormat(fmt))
.build(),
- fmt -> RoundTrip_Tester.create(36, "Proto - default | " + fmt)
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType().uuidFormat(fmt))
- .parser(ProtoParser.create().uuidFormat(fmt))
+ fmt -> RoundTrip_Tester.create(36, "Prototext - default | " + fmt)
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType().uuidFormat(fmt))
+ .parser(PrototextParser.create().uuidFormat(fmt))
.build(),
fmt -> RoundTrip_Tester.create(37, "Hjson - default | " + fmt)
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType().uuidFormat(fmt))
diff --git a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Proto_Test.java b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Prototext_Test.java
similarity index 79%
rename from juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Proto_Test.java
rename to juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Prototext_Test.java
index 77e40c8214..dbef2be1f3 100644
--- a/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Proto_Test.java
+++ b/juneau-core/juneau-marshall/src/test/java/org/apache/juneau/marshaller/Prototext_Test.java
@@ -25,14 +25,14 @@ import org.apache.juneau.marshall.marshaller.*;
import org.junit.jupiter.api.*;
/**
- * Tests for {@link Proto} marshaller.
+ * Tests for {@link Prototext} marshaller.
*/
-class Proto_Test {
+class Prototext_Test {
@Test
void e01_of() {
var bean = JsonMap.of("name", "Alice", "age", 30);
- var proto = Proto.of(bean);
+ var proto = Prototext.of(bean);
assertNotNull(proto);
assertTrue(proto.contains("name"));
assertTrue(proto.contains("Alice"));
@@ -43,7 +43,7 @@ class Proto_Test {
@Test
void e02_to() {
var input = "name: \"Alice\"\nage: 30";
- var bean = Proto.to(input, JsonMap.class);
+ var bean = Prototext.to(input, JsonMap.class);
assertNotNull(bean);
assertEquals("Alice", bean.get("name"));
assertEquals(30L, bean.get("age"));
@@ -52,8 +52,8 @@ class Proto_Test {
@Test
void e03_roundTrip() {
var original = JsonMap.of("s", "hello", "n", 42, "b", true);
- var proto = Proto.of(original);
- var roundTrip = Proto.to(proto, JsonMap.class);
+ var proto = Prototext.of(original);
+ var roundTrip = Prototext.to(proto, JsonMap.class);
assertEquals("hello", roundTrip.get("s"));
assertEquals(42L, roundTrip.get("n"));
assertEquals(true, roundTrip.get("b"));
@@ -62,10 +62,10 @@ class Proto_Test {
@Test
void e04_defaultInstance() {
var bean = JsonMap.of("x", 1);
- var proto = Proto.DEFAULT.write(bean);
+ var proto = Prototext.DEFAULT.write(bean);
assertNotNull(proto);
assertTrue(proto.contains("x"));
- var parsed = Proto.DEFAULT.read(proto, JsonMap.class);
+ var parsed = Prototext.DEFAULT.read(proto, JsonMap.class);
assertEquals(1L, parsed.get("x"));
}
@@ -80,10 +80,10 @@ class Proto_Test {
var bean = new SimpleBean();
bean.name = "Bob";
bean.age = 25;
- var proto = Proto.DEFAULT.write(bean);
+ var proto = Prototext.DEFAULT.write(bean);
assertNotNull(proto);
- assertTrue(proto.contains("Bob"), "Proto must serialize bean fields, got: [" + proto + "]");
- var parsed = Proto.DEFAULT.read(proto, SimpleBean.class);
+ assertTrue(proto.contains("Bob"), "Prototext must serialize bean fields, got: [" + proto + "]");
+ var parsed = Prototext.DEFAULT.read(proto, SimpleBean.class);
assertEquals("Bob", parsed.name);
assertEquals(25, parsed.age);
}
@@ -101,10 +101,10 @@ class Proto_Test {
bean.instant = Instant.parse("2012-12-21T12:34:56Z");
bean.localDate = LocalDate.parse("2012-12-21");
bean.duration = Duration.ofHours(2).plusMinutes(30);
- var proto = Proto.DEFAULT.write(bean);
+ var proto = Prototext.DEFAULT.write(bean);
assertNotNull(proto);
- assertTrue(proto.contains("2012-12-21"), "Proto must serialize date fields");
- var parsed = Proto.DEFAULT.read(proto, DateTimeBean.class);
+ assertTrue(proto.contains("2012-12-21"), "Prototext must serialize date fields");
+ var parsed = Prototext.DEFAULT.read(proto, DateTimeBean.class);
assertEquals(Instant.parse("2012-12-21T12:34:56Z"), parsed.instant);
assertEquals(LocalDate.parse("2012-12-21"), parsed.localDate);
assertEquals(Duration.ofHours(2).plusMinutes(30), parsed.duration);
@@ -114,7 +114,7 @@ class Proto_Test {
void e07_epochMillisToDate() {
var expected = Instant.parse("2012-12-21T12:34:56Z");
var input = "ts: " + expected.toEpochMilli();
- var bean = Proto.to(input, EpochBean.class);
+ var bean = Prototext.to(input, EpochBean.class);
assertNotNull(bean);
assertEquals(expected, bean.ts);
}
diff --git a/juneau-integration-tests/src/test/java/org/apache/juneau/a/rttests/RoundTripDateTime_Test.java b/juneau-integration-tests/src/test/java/org/apache/juneau/a/rttests/RoundTripDateTime_Test.java
index e5924e6a68..1ef50ad000 100644
--- a/juneau-integration-tests/src/test/java/org/apache/juneau/a/rttests/RoundTripDateTime_Test.java
+++ b/juneau-integration-tests/src/test/java/org/apache/juneau/a/rttests/RoundTripDateTime_Test.java
@@ -38,7 +38,7 @@ import org.apache.juneau.marshall.jsonl.*;
import org.apache.juneau.marshall.markdown.*;
import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.parquet.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
import org.apache.juneau.marshall.urlencoding.*;
@@ -203,9 +203,9 @@ class RoundTripDateTime_Test extends TestBase {
.serializer(MarkdownSerializer.create().keepNullProperties().addBeanTypes().addRootType())
.parser(MarkdownParser.create())
.build(),
- tester(36, "Proto - default")
- .serializer(ProtoSerializer.create().keepNullProperties().addBeanTypes().addRootType())
- .parser(ProtoParser.create())
+ tester(36, "Prototext - default")
+ .serializer(PrototextSerializer.create().keepNullProperties().addBeanTypes().addRootType())
+ .parser(PrototextParser.create())
.build(),
tester(37, "Hjson - default")
.serializer(HjsonSerializer.create().ws().keepNullProperties().addBeanTypes().addRootType())
diff --git a/juneau-petstore/juneau-petstore-jetty/src/test/java/org/apache/juneau/petstore/jetty/PetstoreJetty_Test.java b/juneau-petstore/juneau-petstore-jetty/src/test/java/org/apache/juneau/petstore/jetty/PetstoreJetty_Test.java
index 5bc209a950..1abe6306e5 100644
--- a/juneau-petstore/juneau-petstore-jetty/src/test/java/org/apache/juneau/petstore/jetty/PetstoreJetty_Test.java
+++ b/juneau-petstore/juneau-petstore-jetty/src/test/java/org/apache/juneau/petstore/jetty/PetstoreJetty_Test.java
@@ -88,7 +88,7 @@ class PetstoreJetty_Test extends TestBase {
private static HttpResponse<String> get(String path, String accept) throws Exception {
var req = HttpRequest.newBuilder()
.uri(URI.create(fixture.getRootUrl() + path))
- .timeout(Duration.ofSeconds(10))
+ .timeout(Duration.ofSeconds(30))
.header("Accept", accept)
.GET()
.build();
@@ -98,7 +98,7 @@ class PetstoreJetty_Test extends TestBase {
private static HttpResponse<String> getWithAuth(String path, String accept, String authValue) throws Exception {
var req = HttpRequest.newBuilder()
.uri(URI.create(fixture.getRootUrl() + path))
- .timeout(Duration.ofSeconds(10))
+ .timeout(Duration.ofSeconds(30))
.header("Accept", accept)
.header("Authorization", authValue)
.GET()
@@ -109,7 +109,7 @@ class PetstoreJetty_Test extends TestBase {
private static HttpResponse<String> post(String path, String contentType, String body) throws Exception {
var req = HttpRequest.newBuilder()
.uri(URI.create(fixture.getRootUrl() + path))
- .timeout(Duration.ofSeconds(10))
+ .timeout(Duration.ofSeconds(30))
.header("Content-Type", contentType)
.header("Accept", "application/json")
.POST(HttpRequest.BodyPublishers.ofString(body))
@@ -120,7 +120,7 @@ class PetstoreJetty_Test extends TestBase {
private static HttpResponse<String> delete(String path) throws Exception {
var req = HttpRequest.newBuilder()
.uri(URI.create(fixture.getRootUrl() + path))
- .timeout(Duration.ofSeconds(10))
+ .timeout(Duration.ofSeconds(30))
.DELETE()
.build();
return HTTP.send(req, BodyHandlers.ofString());
diff --git a/juneau-rest/juneau-rest-client-classic/src/main/java/org/apache/juneau/rest/client/classic/RestClient.java b/juneau-rest/juneau-rest-client-classic/src/main/java/org/apache/juneau/rest/client/classic/RestClient.java
index b0204d7a05..61b4ca417c 100644
--- a/juneau-rest/juneau-rest-client-classic/src/main/java/org/apache/juneau/rest/client/classic/RestClient.java
+++ b/juneau-rest/juneau-rest-client-classic/src/main/java/org/apache/juneau/rest/client/classic/RestClient.java
@@ -105,7 +105,7 @@ import org.apache.juneau.marshall.parquet.*;
import org.apache.juneau.marshall.parser.*;
import org.apache.juneau.marshall.parser.ParseException;
import org.apache.juneau.marshall.plaintext.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.toml.*;
import org.apache.juneau.marshall.uon.*;
@@ -5374,7 +5374,7 @@ public class RestClient extends MarshallingContextable implements HttpClient, Cl
HjsonSerializer.class,
HoconSerializer.class,
IniSerializer.class,
- ProtoSerializer.class,
+ PrototextSerializer.class,
MarkdownSerializer.class
)
.parsers(
@@ -5395,7 +5395,7 @@ public class RestClient extends MarshallingContextable implements HttpClient, Cl
HjsonParser.class,
HoconParser.class,
IniParser.class,
- ProtoParser.class,
+ PrototextParser.class,
MarkdownParser.class
);
// @formatter:on
diff --git a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/ContentType.java b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/ContentType.java
index 27c81ae70e..890e474dc4 100644
--- a/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/ContentType.java
+++ b/juneau-rest/juneau-rest-common/src/main/java/org/apache/juneau/http/header/ContentType.java
@@ -174,7 +174,7 @@ public class ContentType extends HttpMediaTypeHeader {
public static final ContentType TEXT_OPENAPI = new ContentType("text/openapi");
/** Content-Type for {@code text/plain}. */
public static final ContentType TEXT_PLAIN = new ContentType("text/plain");
- /** Content-Type for {@code text/protobuf} (Juneau {@code ProtoSerializer}/{@code ProtoParser}). */
+ /** Content-Type for {@code text/protobuf} (Juneau {@code PrototextSerializer}/{@code PrototextParser}). */
public static final ContentType TEXT_PROTOBUF = new ContentType("text/protobuf");
/** Content-Type for {@code text/turtle} (RDF Turtle). */
public static final ContentType TEXT_TURTLE = new ContentType("text/turtle");
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicProtoConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicPrototextConfig.java
similarity index 87%
rename from juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicProtoConfig.java
rename to juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicPrototextConfig.java
index 4b345dd214..58bdb7cd13 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicProtoConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicPrototextConfig.java
@@ -16,7 +16,7 @@
*/
package org.apache.juneau.rest.server.config;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.rest.server.*;
/**
@@ -28,8 +28,8 @@ import org.apache.juneau.rest.server.*;
* <ul class='spaced-list'>
* <li class='ja'>{@link Rest}:
* <ul>
- * <li class='jma'>{@link Rest#serializers() serializers}: {@link ProtoSerializer}
- * <li class='jma'>{@link Rest#parsers() parsers}: {@link ProtoParser}
+ * <li class='jma'>{@link Rest#serializers() serializers}: {@link PrototextSerializer}
+ * <li class='jma'>{@link Rest#parsers() parsers}: {@link PrototextParser}
* <li class='jma'>{@link Rest#defaultAccept() defaultAccept}: <js>"text/protobuf"</js>
* </ul>
* </li>
@@ -40,8 +40,8 @@ import org.apache.juneau.rest.server.*;
* </ul>
*/
@Rest(
- serializers={ProtoSerializer.class},
- parsers={ProtoParser.class},
+ serializers={PrototextSerializer.class},
+ parsers={PrototextParser.class},
defaultAccept="text/protobuf"
)
-public interface BasicProtoConfig extends DefaultConfig {}
+public interface BasicPrototextConfig extends DefaultConfig {}
diff --git a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicUniversalConfig.java b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicUniversalConfig.java
index d16add006f..16a2de8d2a 100644
--- a/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicUniversalConfig.java
+++ b/juneau-rest/juneau-rest-server/src/main/java/org/apache/juneau/rest/server/config/BasicUniversalConfig.java
@@ -34,7 +34,7 @@ import org.apache.juneau.marshall.msgpack.*;
import org.apache.juneau.marshall.oapi.*;
import org.apache.juneau.marshall.parquet.*;
import org.apache.juneau.marshall.plaintext.*;
-import org.apache.juneau.marshall.proto.*;
+import org.apache.juneau.marshall.prototext.*;
import org.apache.juneau.marshall.serializer.*;
import org.apache.juneau.marshall.soap.*;
import org.apache.juneau.marshall.toml.*;
@@ -169,7 +169,7 @@ import org.apache.juneau.rest.server.servlet.*;
TomlSerializer.class,
IniSerializer.class,
ParquetSerializer.class,
- ProtoSerializer.class,
+ PrototextSerializer.class,
MarkdownSerializer.class
},
@@ -194,7 +194,7 @@ import org.apache.juneau.rest.server.servlet.*;
TomlParser.class,
IniParser.class,
ParquetParser.class,
- ProtoParser.class,
+ PrototextParser.class,
MarkdownParser.class
},