You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by ch...@apache.org on 2026/08/14 03:51:47 UTC

(fory) branch main updated: feat(scala): add json support for scala (#3934)

This is an automated email from the ASF dual-hosted git repository.

chaokunyang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/fory.git


The following commit(s) were added to refs/heads/main by this push:
     new f44ff568e feat(scala): add json support for scala (#3934)
f44ff568e is described below

commit f44ff568e5cddedaae6e608d27a023567323800f
Author: Shawn Yang <sh...@gmail.com>
AuthorDate: Fri Aug 14 11:51:43 2026 +0800

    feat(scala): add json support for scala (#3934)
    
    ## Why?
    
    
    
    ## What does this PR do?
    
    
    
    ## Related issues
    
    
    
    ## AI Contribution Checklist
    
    
    
    - [ ] Substantial AI assistance was used in this PR: `yes` / `no`
    - [ ] If `yes`, I included a completed [AI Contribution
    Checklist](https://github.com/apache/fory/blob/main/AI_POLICY.md#9-contributor-checklist-for-ai-assisted-prs)
    in this PR description and the required `AI Usage Disclosure`.
    - [ ] If `yes`, my PR description includes the required `ai_review`
    summary and screenshot evidence or equivalent persisted links of the
    final clean AI review results from both fresh reviewers described in
    `AI_POLICY.md`, the Fory-guided reviewer and the independent general
    reviewer, on the current PR diff or current HEAD after the latest code
    changes.
    
    
    
    ## Does this PR introduce any user-facing change?
    
    
    
    - [ ] Does this PR introduce any public API change?
    - [ ] Does this PR introduce any binary protocol compatibility change?
    
    ## Benchmark
---
 .agents/languages/scala.md                         |   3 +
 .agents/skills/fory-version-bump/SKILL.md          |   1 +
 benchmarks/scala/README.md                         |  21 +
 benchmarks/scala/build.sbt                         |  38 ++
 benchmarks/scala/plot_json_benchmark.py            | 285 +++++++++
 benchmarks/scala/project/build.properties          |  18 +
 benchmarks/scala/project/plugins.sbt               |   1 +
 benchmarks/scala/run_json_benchmark.py             | 202 +++++++
 .../benchmark/json/MediaContentBenchmark.scala     | 125 ++++
 .../scala/src/main/resources/data/eishay.json      |  30 +
 .../apache/fory/benchmark/json/JsonCodecs.scala    |  41 ++
 .../apache/fory/benchmark/json/MediaContent.scala  |  42 +-
 .../benchmark/json/MediaContentCodecSuite.scala    |  50 ++
 benchmarks/scala/test_plot_json_benchmark.py       |  88 +++
 ci/release.py                                      |   5 +-
 ci/test_release.py                                 |  20 +
 docs/benchmarks/json/scala/README.md               |  41 ++
 docs/benchmarks/json/scala/benchmark_results.json  | 350 +++++++++++
 docs/benchmarks/json/scala/string_throughput.png   | Bin 0 -> 47675 bytes
 .../json/scala/utf8_bytes_throughput.png           | Bin 0 -> 51475 bytes
 docs/json/android.md                               |   2 +-
 docs/json/graalvm.md                               |   2 +-
 docs/json/index.md                                 |   6 +-
 docs/json/modules.md                               | 107 ++++
 docs/json/scala.md                                 | 214 +++++++
 docs/json/security.md                              |   2 +-
 docs/json/troubleshooting.md                       |   2 +-
 java/fory-json/README.md                           |   4 +
 .../main/java/org/apache/fory/json/ForyJson.java   |  11 +-
 .../java/org/apache/fory/json/ForyJsonBuilder.java |  49 +-
 .../java/org/apache/fory/json/ForyJsonModule.java  |  30 +-
 .../org/apache/fory/json/JsonCodecFactory.java     |  48 +-
 .../main/java/org/apache/fory/json/JsonConfig.java |  49 +-
 .../java/org/apache/fory/json/ModuleContext.java   |  27 +-
 .../java/org/apache/fory/json/ModuleInstaller.java | 177 ++++++
 .../apache/fory/json/annotation/JsonIgnore.java    |  15 +-
 .../apache/fory/json/codec/ClosedSubtypeCodec.java | 138 ++++-
 .../apache/fory/json/codec/CompositeJsonCodec.java |  43 ++
 .../apache/fory/json/codec/JsonObjectModel.java    | 115 ++++
 .../java/org/apache/fory/json/codec/MapCodec.java  |   6 +
 .../org/apache/fory/json/codec/ObjectCodec.java    |  31 +-
 .../apache/fory/json/codec/ObjectCodecBuilder.java | 389 ++++++++++--
 .../fory/json/codegen/JsonReaderCodegen.java       | 435 ++++++++++----
 .../fory/json/codegen/JsonWriterCodegen.java       |  23 +-
 .../fory/json/codegen/Latin1ReaderCodegen.java     |   4 +-
 .../fory/json/codegen/Utf16ReaderCodegen.java      |   4 +-
 .../fory/json/codegen/Utf8ReaderCodegen.java       |   4 +-
 .../fory/json/codegen/Utf8WriterCodegen.java       |   1 +
 .../org/apache/fory/json/meta/JsonCreatorInfo.java | 344 ++++++++++-
 .../org/apache/fory/json/meta/JsonFieldInfo.java   | 145 ++++-
 .../org/apache/fory/json/reader/JsonReader.java    |  37 ++
 .../apache/fory/json/resolver/CodecRegistry.java   | 131 +++-
 .../fory/json/resolver/JsonSharedRegistry.java     | 116 +++-
 .../fory/json/resolver/JsonTypeResolver.java       | 465 +++++++++++++--
 .../resolver/UnsupportedJsonTypeException.java     |  25 +-
 .../apache/fory/json/ForyJsonGraalVMFeature.java   | 100 +++-
 .../apache/fory/json/JsonAsyncCompilationTest.java |   3 +
 .../java/org/apache/fory/json/JsonCreatorTest.java |  87 +++
 .../java/org/apache/fory/json/JsonModuleTest.java  | 358 +++++++++++
 .../java/org/apache/fory/json/JsonObjectTest.java  |  45 ++
 .../java/org/apache/fory/json/JsonTestSupport.java |   3 +
 scala/README.md                                    | 212 +------
 scala/build.sbt                                    | 110 ++--
 scala/fory-json-scala/README.md                    |  40 ++
 .../org/apache/fory/json/scala/ScalaTypeRef.scala} |  14 +-
 .../json/scala/internal/ScalaDerivedCodec.scala}   |  13 +-
 .../json/scala/internal/ScalaTypeRefMacros.scala   |  54 ++
 .../apache/fory/json/scala/ScalaJsonCodec.scala}   |  32 +-
 .../org/apache/fory/json/scala/ScalaTypeRef.scala} |  15 +-
 .../scala/internal/DerivedScalaJsonCodec.scala     | 100 ++++
 .../json/scala/internal/ScalaDerivedCodec.scala    |  53 ++
 .../json/scala/internal/ScalaJsonCodecMacros.scala |  62 ++
 .../json/scala/internal/ScalaTypeRefMacros.scala   |  52 ++
 .../apache/fory/json/scala/ForyJsonScala.scala}    |  26 +-
 .../fory/json/scala/ScalaEnumerationCodec.scala    |  67 +++
 .../json/scala/internal/ScalaAlgebraicCodecs.scala | 239 ++++++++
 .../json/scala/internal/ScalaBitSetCodec.scala     | 102 ++++
 .../scala/internal/ScalaCollectionCodecs.scala     | 661 +++++++++++++++++++++
 .../fory/json/scala/internal/ScalaEnumCodec.scala  | 106 ++++
 .../scala/internal/ScalaNumericRangeCodec.scala    | 315 ++++++++++
 .../json/scala/internal/ScalaObjectModels.scala    | 253 ++++++++
 .../json/scala/internal/ScalaProductCodecs.scala   | 142 +++++
 .../json/scala/internal/ScalaScalarCodecs.scala    | 229 +++++++
 .../fory/json/scala/internal/ScalaTupleCodec.scala | 514 ++++++++++++++++
 .../scala/internal/ScalaTypeCodecFactory.scala     | 281 +++++++++
 .../json/scala/internal/ScalaTypeSupport.scala     | 110 ++++
 .../fory/json/scala/internal/ScalaUnitCodec.scala} |  28 +-
 .../fory/json/scala/ScalaJsonDerivationSuite.scala |  90 +++
 .../fory/json/scala/ScalaJsonNativeImageMain.scala |  69 +++
 .../apache/fory/json/scala/ScalaJsonSuite.scala    | 307 ++++++++++
 scala/{ => fory-scala}/README.md                   |  44 +-
 .../fory/serializer/scala/ScalaEnumSerializer.java |   0
 .../serializer/scala/ScalaSerializerFactory.java   |   0
 .../fory/serializer/scala/ScalaSerializers.java    |   0
 .../serializer/scala/ToFactorySerializers.java     |   0
 .../fory-core/native-image.properties              |   0
 .../org/apache/fory/scala/ForyExtensions.scala     |   0
 .../org/apache/fory/scala/ForySerializer.scala     |   0
 .../fory/scala/internal/ForySerializerMacros.scala |   0
 .../scala/org/apache/fory/scala/ForyScala.scala    |   0
 .../org/apache/fory/scala/rpc/RpcFuture.scala      |   0
 .../org/apache/fory/scala/rpc/RpcIterator.scala    |   0
 .../serializer/scala/CollectionSerializer.scala    |   0
 .../fory/serializer/scala/MapSerializer.scala      |   0
 .../fory/serializer/scala/RangeSerializer.scala    |   0
 .../scala/XlangCollectionSerializer.scala          |   0
 .../scala/LombokDefaultLikeJavaPojo.java           |   0
 .../fory/util/ConstructorDefaultLikeJavaClass.java |   0
 .../fory/util/LombokDefaultLikeJavaClass.java      |   0
 .../scala/ForySerializerDerivationTest.scala       |   0
 .../fory/serializer/scala/ScalaEnumTest.scala      |   0
 .../fory/serializer/scala/ScalaXlangPeer.scala     |   0
 .../org/apache/fory/scala/rpc/RpcHandleTest.scala  |   0
 .../scala/CollectionSerializerTest.scala           |   0
 .../CompatibleSingleObjectSerializerTest.scala     |   0
 .../fory/serializer/scala/DurationTest.scala       |   0
 .../scala/MutableCollectionSerializerTest.scala    |   0
 .../apache/fory/serializer/scala/RangeTest.scala   |   0
 .../serializer/scala/ScalaDefaultValueTest.scala   |   0
 .../apache/fory/serializer/scala/ScalaTest.scala   |   0
 .../scala/ScalaXlangSerializerTest.scala           |   0
 .../scala/SingleObjectSerializerTest.scala         |   0
 .../apache/fory/serializer/scala/TupleTest.scala   |   0
 .../serializer/scala/TypeUseAnnotationTest.scala   |   0
 .../fory/util/ScalaDefaultValueUtilsTest.scala     |   0
 125 files changed, 8736 insertions(+), 762 deletions(-)

diff --git a/.agents/languages/scala.md b/.agents/languages/scala.md
index cdc9459be..ecfd3b07e 100644
--- a/.agents/languages/scala.md
+++ b/.agents/languages/scala.md
@@ -6,6 +6,9 @@ Load this file when changing `scala/`.
 
 - Run Scala commands from within `scala/`.
 - Scala serializers build on the Java implementation. If Java changed and the updated Java artifacts are not installed yet, run `cd ../java && mvn -T16 install -DskipTests` first.
+- Scala supports the JVM and GraalVM Native Image, not Android. Do not add Android-specific Scala
+  sources, tests, resources, R8 metadata, compiler plugins, macros, dependencies, or compatibility
+  design.
 
 ## Commands
 
diff --git a/.agents/skills/fory-version-bump/SKILL.md b/.agents/skills/fory-version-bump/SKILL.md
index c0bc073f6..9cc06aecd 100644
--- a/.agents/skills/fory-version-bump/SKILL.md
+++ b/.agents/skills/fory-version-bump/SKILL.md
@@ -54,6 +54,7 @@ python ci/release.py bump_version -l all -version <next-dev-version> \
 - `integration_tests/idl_tests/dart/pubspec.yaml`
 - `integration_tests/idl_tests/rust/Cargo.lock`
 - `dart/CHANGELOG.md` and `dart/packages/fory/CHANGELOG.md`
+- `scala/fory-scala/README.md` and `scala/fory-json-scala/README.md`
 
 5. Search for stale previous development forms and accidental next-development
    versions in user-facing docs:
diff --git a/benchmarks/scala/README.md b/benchmarks/scala/README.md
new file mode 100644
index 000000000..88a8ece38
--- /dev/null
+++ b/benchmarks/scala/README.md
@@ -0,0 +1,21 @@
+# Scala JSON Benchmarks
+
+This JMH suite compares `fory-json-scala`, `jsoniter-scala`, and Jackson Scala with the same
+immutable Scala `MediaContent` model and Eishay JSON document.
+
+The suite contains twelve benchmarks: three libraries, String and UTF-8 byte-array representations,
+and serialization and deserialization operations. Library instances, generated codecs, model data,
+and input documents are prepared once in JMH setup and are not part of the measured operation.
+
+String benchmarks exclude UTF-8 conversion. All three byte-array benchmarks call direct byte APIs.
+Setup verifies that every library decodes the fixture to the same model and round-trips its own
+output.
+
+The generated report contains separate String and UTF-8 charts. Each serialize or deserialize panel
+contains three bars, followed by raw throughput and Fory performance-advantage tables.
+
+`run_json_benchmark.py` rotates the library order across short JMH runs and reports the median for
+each case. This reduces bias from changing machine load while retaining the same fork, thread, and
+operation boundaries for all three libraries.
+
+Published results are stored in [the Scala JSON benchmark report](../../docs/benchmarks/json/scala/README.md).
diff --git a/benchmarks/scala/build.sbt b/benchmarks/scala/build.sbt
new file mode 100644
index 000000000..fa0bb3358
--- /dev/null
+++ b/benchmarks/scala/build.sbt
@@ -0,0 +1,38 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ThisBuild / scalaVersion := "3.3.1"
+ThisBuild / organization := "org.apache.fory.benchmark"
+ThisBuild / version := "1.0-SNAPSHOT"
+
+lazy val root = (project in file("."))
+  .enablePlugins(JmhPlugin)
+  .settings(
+    name := "fory-scala-json-benchmarks",
+    resolvers += Resolver.mavenLocal,
+    libraryDependencies ++= Seq(
+      "org.apache.fory" %% "fory-json-scala" % "1.7.0-SNAPSHOT",
+      "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % "2.40.1",
+      "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % "2.40.1" % Provided,
+      "com.fasterxml.jackson.module" %% "jackson-module-scala" % "2.22.1",
+      "org.scalameta" %% "munit" % "1.3.5" % Test,
+    ),
+    Test / fork := true,
+    Test / javaOptions += "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+    Jmh / javaOptions += "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+  )
diff --git a/benchmarks/scala/plot_json_benchmark.py b/benchmarks/scala/plot_json_benchmark.py
new file mode 100644
index 000000000..6b9699b7e
--- /dev/null
+++ b/benchmarks/scala/plot_json_benchmark.py
@@ -0,0 +1,285 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Generate Scala JSON benchmark charts and a Markdown report from JMH JSON."""
+
+from __future__ import annotations
+
+import argparse
+import json
+import math
+import re
+import sys
+from datetime import date
+from pathlib import Path
+from typing import Any
+
+import matplotlib.pyplot as plt
+import numpy as np
+from matplotlib.ticker import FuncFormatter
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1]))
+from plot_style import (  # noqa: E402
+    BAR_EDGE_COLOR,
+    apply_benchmark_style,
+    format_markdown_with_prettier,
+    format_throughput_label,
+    format_throughput_tick,
+    save_benchmark_figure,
+    style_throughput_axis,
+)
+
+apply_benchmark_style(plt)
+
+SERIALIZERS = ("fory", "jsoniter", "jackson")
+LABELS = {
+    "fory": "fory-json-scala",
+    "jsoniter": "jsoniter-scala",
+    "jackson": "Jackson Scala",
+}
+COLORS = {
+    "fory": "#FF6F01",
+    "jsoniter": "#4C78A8",
+    "jackson": "#55BCC2",
+}
+OPERATIONS = ("to", "from")
+REPRESENTATIONS = ("string", "bytes")
+BENCHMARK_PATTERN = re.compile(
+    r"(?:^|[.])(?P<serializer>fory|jsoniter|jackson)"
+    r"(?P<operation>To|From)Json(?P<representation>Bytes|String)$"
+)
+
+
+def parse_args() -> argparse.Namespace:
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument("--json-file", default="reports/json/benchmark_results.json")
+    parser.add_argument("--output-dir", default="reports/json")
+    parser.add_argument("--source-commit", default="unknown")
+    parser.add_argument("--platform", default="unknown")
+    parser.add_argument("--benchmark-date", default=date.today().isoformat())
+    return parser.parse_args()
+
+
+def load_json(path: Path) -> list[dict[str, Any]]:
+    with path.open("r", encoding="utf-8") as source:
+        value = json.load(source)
+    benchmarks = value if isinstance(value, list) else value.get("benchmarks", [])
+    if not isinstance(benchmarks, list):
+        raise TypeError(f"Expected a JMH benchmark list in {path}")
+    return benchmarks
+
+
+def ops_per_second(value: float, unit: str) -> float:
+    multiplier = {
+        "ops/s": 1,
+        "ops/ms": 1_000,
+        "ops/us": 1_000_000,
+        "ops/ns": 1_000_000_000,
+    }.get(unit)
+    if multiplier is None:
+        raise ValueError(f"Unsupported JMH throughput unit: {unit}")
+    return value * multiplier
+
+
+def collect_results(
+    benchmarks: list[dict[str, Any]],
+) -> dict[tuple[str, str], dict[str, tuple[float, float]]]:
+    results = {
+        (operation, representation): {}
+        for representation in REPRESENTATIONS
+        for operation in OPERATIONS
+    }
+    for benchmark in benchmarks:
+        match = BENCHMARK_PATTERN.search(benchmark.get("benchmark", ""))
+        if match is None:
+            continue
+        key = (match.group("operation").lower(), match.group("representation").lower())
+        metric = benchmark["primaryMetric"]
+        unit = metric.get("scoreUnit", "ops/s")
+        score = ops_per_second(float(metric["score"]), unit)
+        error = ops_per_second(float(metric.get("scoreError", 0)), unit)
+        results[key][match.group("serializer")] = (
+            score,
+            error if math.isfinite(error) else 0,
+        )
+    missing = [
+        f"{serializer}{operation.title()}Json{representation.title()}"
+        for representation in REPRESENTATIONS
+        for operation in OPERATIONS
+        for serializer in SERIALIZERS
+        if serializer not in results[(operation, representation)]
+    ]
+    if missing:
+        raise ValueError("Missing JMH benchmark results: " + ", ".join(missing))
+    return results
+
+
+def render_plot(
+    results: dict[tuple[str, str], dict[str, tuple[float, float]]],
+    representation: str,
+    output: Path,
+) -> None:
+    figure, axes = plt.subplots(1, 2, figsize=(11.5, 5.2))
+    x = np.arange(len(SERIALIZERS), dtype=float)
+    for axis, operation in zip(axes, OPERATIONS):
+        values = [results[(operation, representation)][name][0] for name in SERIALIZERS]
+        errors = [results[(operation, representation)][name][1] for name in SERIALIZERS]
+        bars = axis.bar(
+            x,
+            values,
+            width=0.62,
+            yerr=errors,
+            capsize=2.5,
+            color=[COLORS[name] for name in SERIALIZERS],
+            edgecolor=BAR_EDGE_COLOR,
+            linewidth=0.8,
+        )
+        axis.bar_label(
+            bars,
+            labels=[format_throughput_label(value) for value in values],
+            padding=3,
+            fontsize=8,
+        )
+        axis.set_ylim(
+            0, max(value + error for value, error in zip(values, errors)) * 1.18
+        )
+        axis.set_xticks(x)
+        axis.set_xticklabels([LABELS[name] for name in SERIALIZERS])
+        axis.set_title("Serialize" if operation == "to" else "Deserialize", pad=10)
+        axis.yaxis.set_major_formatter(FuncFormatter(format_throughput_tick))
+        style_throughput_axis(axis)
+    axes[0].set_ylabel("Throughput (ops/sec)")
+    shape = "String" if representation == "string" else "UTF-8 Bytes"
+    figure.suptitle(f"Scala JSON {shape} Throughput", y=0.98)
+    figure.tight_layout(rect=[0, 0, 1, 0.95], w_pad=2.4)
+    save_benchmark_figure(figure, output)
+    plt.close(figure)
+
+
+def metadata(benchmarks: list[dict[str, Any]]) -> list[str]:
+    if not benchmarks:
+        return []
+    first = benchmarks[0]
+    values = []
+    for label, key in (("JDK", "jdkVersion"), ("VM", "vmName"), ("JMH", "jmhVersion")):
+        if first.get(key):
+            values.append(f"{label}: `{first[key]}`")
+    if first.get("warmupIterations") is not None and first.get("warmupTime"):
+        values.append(
+            f"Warmup: {first['warmupIterations']} iterations × `{first['warmupTime']}`"
+        )
+    if first.get("measurementIterations") is not None and first.get("measurementTime"):
+        values.append(
+            "Measurement: "
+            f"{first['measurementIterations']} iterations × `{first['measurementTime']}`"
+        )
+    values.append(f"Forks: {first.get('forks', 1)}; threads: {first.get('threads', 1)}")
+    if first.get("alternatingRounds"):
+        values.append(
+            "Aggregation: median of "
+            f"{first['alternatingRounds']} alternating short runs; error bars show the "
+            "maximum cross-run deviation"
+        )
+    values.append("Mode: throughput; higher is better")
+    return values
+
+
+def improvement(fory: float, other: float) -> str:
+    return f"{(fory / other - 1) * 100:.1f}%"
+
+
+def render_report(
+    benchmarks: list[dict[str, Any]],
+    results: dict[tuple[str, str], dict[str, tuple[float, float]]],
+    output: Path,
+    source_commit: str,
+    platform: str,
+    benchmark_date: str,
+) -> None:
+    lines = [
+        "# Scala JSON Benchmark Report\n\n",
+        "The benchmark compares fory-json-scala, jsoniter-scala, and Jackson Scala on the "
+        "same immutable Scala MediaContent model and Eishay JSON document. The String group "
+        "excludes UTF-8 conversion; every library in the UTF-8 group uses its direct byte-array "
+        "API.\n\n",
+        f"- Benchmark date: `{benchmark_date}`\n",
+        f"- Source commit: `{source_commit}`\n",
+        f"- Platform: {platform}\n",
+    ]
+    lines.extend(f"- {item}\n" for item in metadata(benchmarks))
+    lines.extend(
+        [
+            "\n## String\n\n",
+            "![Scala JSON String benchmark throughput](string_throughput.png)\n\n",
+            "## UTF-8 Bytes\n\n",
+            "![Scala JSON UTF-8 bytes benchmark throughput](utf8_bytes_throughput.png)\n\n",
+            "## Results\n\n",
+            "| Representation | Operation | fory-json-scala ops/sec | jsoniter-scala ops/sec | Jackson Scala ops/sec | Fastest |\n",
+            "| --- | --- | ---: | ---: | ---: | --- |\n",
+        ]
+    )
+    for representation in REPRESENTATIONS:
+        for operation in OPERATIONS:
+            values = results[(operation, representation)]
+            fastest = max(SERIALIZERS, key=lambda name: values[name][0])
+            lines.append(
+                f"| {'String' if representation == 'string' else 'UTF-8 bytes'} | "
+                f"{'Serialize' if operation == 'to' else 'Deserialize'} | "
+                f"{values['fory'][0]:,.0f} | {values['jsoniter'][0]:,.0f} | "
+                f"{values['jackson'][0]:,.0f} | {LABELS[fastest]} |\n"
+            )
+    lines.extend(
+        [
+            "\n## Fory performance advantage\n\n",
+            "| Representation | Operation | vs jsoniter-scala | vs Jackson Scala |\n",
+            "| --- | --- | ---: | ---: |\n",
+        ]
+    )
+    for representation in REPRESENTATIONS:
+        for operation in OPERATIONS:
+            values = results[(operation, representation)]
+            lines.append(
+                f"| {'String' if representation == 'string' else 'UTF-8 bytes'} | "
+                f"{'Serialize' if operation == 'to' else 'Deserialize'} | "
+                f"{improvement(values['fory'][0], values['jsoniter'][0])} | "
+                f"{improvement(values['fory'][0], values['jackson'][0])} |\n"
+            )
+    output.write_text("".join(lines), encoding="utf-8")
+    format_markdown_with_prettier(output)
+
+
+def main() -> None:
+    args = parse_args()
+    benchmarks = load_json(Path(args.json_file))
+    results = collect_results(benchmarks)
+    output_dir = Path(args.output_dir)
+    output_dir.mkdir(parents=True, exist_ok=True)
+    render_plot(results, "string", output_dir / "string_throughput.png")
+    render_plot(results, "bytes", output_dir / "utf8_bytes_throughput.png")
+    render_report(
+        benchmarks,
+        results,
+        output_dir / "README.md",
+        args.source_commit,
+        args.platform,
+        args.benchmark_date,
+    )
+
+
+if __name__ == "__main__":
+    main()
diff --git a/benchmarks/scala/project/build.properties b/benchmarks/scala/project/build.properties
new file mode 100644
index 000000000..d5ba1b9b7
--- /dev/null
+++ b/benchmarks/scala/project/build.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+sbt.version=1.12.11
diff --git a/benchmarks/scala/project/plugins.sbt b/benchmarks/scala/project/plugins.sbt
new file mode 100644
index 000000000..59778b9d7
--- /dev/null
+++ b/benchmarks/scala/project/plugins.sbt
@@ -0,0 +1 @@
+addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.8")
diff --git a/benchmarks/scala/run_json_benchmark.py b/benchmarks/scala/run_json_benchmark.py
new file mode 100644
index 000000000..57a81743f
--- /dev/null
+++ b/benchmarks/scala/run_json_benchmark.py
@@ -0,0 +1,202 @@
+#!/usr/bin/env python3
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+"""Run alternating short Scala JSON JMH trials and generate the report."""
+
+from __future__ import annotations
+
+import argparse
+import copy
+import json
+import platform
+import statistics
+import subprocess
+import sys
+from datetime import date
+from pathlib import Path
+from typing import Any
+
+LIBRARIES = ("fory", "jsoniter", "jackson")
+BENCHMARK_CLASS = "org.apache.fory.benchmark.json.MediaContentBenchmark"
+
+
+def parse_args() -> argparse.Namespace:
+    parser = argparse.ArgumentParser(description=__doc__)
+    parser.add_argument("--rounds", type=int, default=3)
+    parser.add_argument("--warmup-iterations", type=int, default=1)
+    parser.add_argument("--iterations", type=int, default=2)
+    parser.add_argument("--duration", default="500ms")
+    parser.add_argument("--output-dir", default="reports/json")
+    parser.add_argument("--skip-build", action="store_true")
+    args = parser.parse_args()
+    for name in ("rounds", "warmup_iterations", "iterations"):
+        if getattr(args, name) <= 0:
+            parser.error(f"--{name.replace('_', '-')} must be positive")
+    return args
+
+
+def run(command: list[str], cwd: Path, log: Path) -> None:
+    log.parent.mkdir(parents=True, exist_ok=True)
+    print(f"Running in {cwd}: {' '.join(command)}", flush=True)
+    with log.open("w", encoding="utf-8") as output:
+        result = subprocess.run(
+            command,
+            cwd=cwd,
+            stdout=output,
+            stderr=subprocess.STDOUT,
+            text=True,
+            check=False,
+        )
+    if result.returncode != 0:
+        raise RuntimeError(
+            f"Command failed with exit code {result.returncode}; see {log}"
+        )
+
+
+def alternating_order(round_index: int) -> tuple[str, ...]:
+    offset = round_index % len(LIBRARIES)
+    return LIBRARIES[offset:] + LIBRARIES[:offset]
+
+
+def load_results(path: Path) -> list[dict[str, Any]]:
+    with path.open("r", encoding="utf-8") as source:
+        value = json.load(source)
+    if not isinstance(value, list):
+        raise TypeError(f"Expected a JMH result list in {path}")
+    return value
+
+
+def aggregate_results(
+    trials: list[list[dict[str, Any]]], rounds: int
+) -> list[dict[str, Any]]:
+    grouped: dict[str, list[dict[str, Any]]] = {}
+    for trial in trials:
+        for benchmark in trial:
+            grouped.setdefault(benchmark["benchmark"], []).append(benchmark)
+
+    expected = rounds
+    aggregated = []
+    for name in sorted(grouped):
+        samples = grouped[name]
+        if len(samples) != expected:
+            raise ValueError(f"Expected {expected} alternating samples for {name}")
+        result = copy.deepcopy(samples[0])
+        scores = [float(sample["primaryMetric"]["score"]) for sample in samples]
+        median = statistics.median(scores)
+        result["primaryMetric"]["score"] = median
+        result["primaryMetric"]["scoreError"] = max(
+            abs(score - median) for score in scores
+        )
+        for field in ("rawData", "scoreConfidence", "scorePercentiles"):
+            result["primaryMetric"].pop(field, None)
+        result["alternatingRounds"] = rounds
+        result["aggregation"] = "median"
+        aggregated.append(result)
+    if len(aggregated) != 12:
+        raise ValueError(f"Expected 12 Scala JSON benchmarks, found {len(aggregated)}")
+    return aggregated
+
+
+def source_commit(root: Path) -> str:
+    result = subprocess.run(
+        ["git", "rev-parse", "HEAD"],
+        cwd=root,
+        capture_output=True,
+        text=True,
+        check=True,
+    )
+    return result.stdout.strip()
+
+
+def main() -> None:
+    args = parse_args()
+    benchmark_dir = Path(__file__).resolve().parent
+    root = benchmark_dir.parents[1]
+    output_dir = Path(args.output_dir)
+    if not output_dir.is_absolute():
+        output_dir = benchmark_dir / output_dir
+    raw_dir = output_dir / "alternating-runs"
+    raw_dir.mkdir(parents=True, exist_ok=True)
+
+    if not args.skip_build:
+        run(
+            [
+                "mvn",
+                "-B",
+                "--no-transfer-progress",
+                "-pl",
+                "fory-json",
+                "-am",
+                "install",
+                "-DskipTests",
+                "-Dmaven.javadoc.skip=true",
+            ],
+            root / "java",
+            raw_dir / "build-java.log",
+        )
+        run(
+            ["sbt", "++3.3.1", "fory-json-scala/publishM2"],
+            root / "scala",
+            raw_dir / "build-scala.log",
+        )
+        run(
+            ["sbt", "Jmh/compile"],
+            benchmark_dir,
+            raw_dir / "build-benchmark.log",
+        )
+
+    trials: list[list[dict[str, Any]]] = []
+    for round_index in range(args.rounds):
+        for library in alternating_order(round_index):
+            result_file = raw_dir / f"round-{round_index + 1}-{library}.json"
+            selector = f"{BENCHMARK_CLASS}.{library}(To|From)Json(Bytes|String)$"
+            jmh_args = (
+                f"Jmh/run {selector} -f 1 -wi {args.warmup_iterations} "
+                f"-i {args.iterations} -t 1 -w {args.duration} -r {args.duration} "
+                f"-bm thrpt -tu s -rf json -rff {result_file}"
+            )
+            log = raw_dir / f"round-{round_index + 1}-{library}.log"
+            run(["sbt", jmh_args], benchmark_dir, log)
+            trials.append(load_results(result_file))
+
+    aggregate = aggregate_results(trials, args.rounds)
+    result_file = output_dir / "benchmark_results.json"
+    result_file.write_text(json.dumps(aggregate, indent=2) + "\n", encoding="utf-8")
+    run(
+        [
+            sys.executable,
+            str(benchmark_dir / "plot_json_benchmark.py"),
+            "--json-file",
+            str(result_file),
+            "--output-dir",
+            str(output_dir),
+            "--source-commit",
+            source_commit(root),
+            "--platform",
+            f"{platform.platform()} ({platform.machine()})",
+            "--benchmark-date",
+            date.today().isoformat(),
+        ],
+        benchmark_dir,
+        raw_dir / "plot.log",
+    )
+    print(f"Scala JSON benchmark report: {output_dir / 'README.md'}")
+
+
+if __name__ == "__main__":
+    main()
diff --git a/benchmarks/scala/src/jmh/scala/org/apache/fory/benchmark/json/MediaContentBenchmark.scala b/benchmarks/scala/src/jmh/scala/org/apache/fory/benchmark/json/MediaContentBenchmark.scala
new file mode 100644
index 000000000..9b5529b7a
--- /dev/null
+++ b/benchmarks/scala/src/jmh/scala/org/apache/fory/benchmark/json/MediaContentBenchmark.scala
@@ -0,0 +1,125 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.benchmark.json
+
+import java.nio.charset.StandardCharsets
+import java.util.concurrent.TimeUnit
+
+import com.github.plokhotnyuk.jsoniter_scala.core.{readFromArray, readFromString, writeToArray, writeToString}
+import org.openjdk.jmh.annotations.*
+
+@State(Scope.Thread)
+class BenchmarkState:
+  import JsonCodecs.given
+
+  var mediaContent: MediaContent = null
+  var jsonString: String = null
+  var jsonBytes: Array[Byte] = null
+
+  @Setup
+  def setup(): Unit =
+    jsonString = readResource()
+    jsonBytes = jsonString.getBytes(StandardCharsets.UTF_8)
+    mediaContent = readFromString[MediaContent](jsonString)
+
+    verify(JsonCodecs.foryJson.fromJson(jsonString, classOf[MediaContent]))
+    verify(JsonCodecs.foryJson.fromJson(jsonBytes, classOf[MediaContent]))
+    verify(readFromString[MediaContent](jsonString))
+    verify(readFromArray[MediaContent](jsonBytes))
+    verify(JsonCodecs.jacksonMapper.readValue(jsonString, classOf[MediaContent]))
+    verify(JsonCodecs.jacksonMapper.readValue(jsonBytes, classOf[MediaContent]))
+
+    verify(JsonCodecs.foryJson.fromJson(JsonCodecs.foryJson.toJson(mediaContent), classOf[MediaContent]))
+    verify(
+      JsonCodecs.foryJson.fromJson(
+        JsonCodecs.foryJson.toJsonBytes(mediaContent),
+        classOf[MediaContent],
+      )
+    )
+    verify(readFromArray[MediaContent](writeToArray(mediaContent)))
+    verify(
+      JsonCodecs.jacksonMapper.readValue(
+        JsonCodecs.jacksonMapper.writeValueAsBytes(mediaContent),
+        classOf[MediaContent],
+      )
+    )
+
+  private def verify(decoded: MediaContent): Unit =
+    require(JsonCodecs.mediaContentEquals(decoded, mediaContent), "codec produced different MediaContent")
+
+  private def readResource(): String =
+    val stream = Option(getClass.getClassLoader.getResourceAsStream("data/eishay.json"))
+      .getOrElse(throw IllegalStateException("Missing data/eishay.json"))
+    try String(stream.readAllBytes(), StandardCharsets.UTF_8)
+    finally stream.close()
+
+@BenchmarkMode(Array(Mode.Throughput))
+@OutputTimeUnit(TimeUnit.SECONDS)
+@Warmup(iterations = 3, time = 2)
+@Measurement(iterations = 5, time = 2)
+@Fork(1)
+@Threads(1)
+class MediaContentBenchmark:
+  import JsonCodecs.given
+
+  @Benchmark
+  def foryToJsonBytes(state: BenchmarkState): Array[Byte] =
+    JsonCodecs.foryJson.toJsonBytes(state.mediaContent)
+
+  @Benchmark
+  def jsoniterToJsonBytes(state: BenchmarkState): Array[Byte] = writeToArray(state.mediaContent)
+
+  @Benchmark
+  def jacksonToJsonBytes(state: BenchmarkState): Array[Byte] =
+    JsonCodecs.jacksonMapper.writeValueAsBytes(state.mediaContent)
+
+  @Benchmark
+  def foryToJsonString(state: BenchmarkState): String = JsonCodecs.foryJson.toJson(state.mediaContent)
+
+  @Benchmark
+  def jsoniterToJsonString(state: BenchmarkState): String = writeToString(state.mediaContent)
+
+  @Benchmark
+  def jacksonToJsonString(state: BenchmarkState): String =
+    JsonCodecs.jacksonMapper.writeValueAsString(state.mediaContent)
+
+  @Benchmark
+  def foryFromJsonBytes(state: BenchmarkState): MediaContent =
+    JsonCodecs.foryJson.fromJson(state.jsonBytes, classOf[MediaContent])
+
+  @Benchmark
+  def jsoniterFromJsonBytes(state: BenchmarkState): MediaContent =
+    readFromArray[MediaContent](state.jsonBytes)
+
+  @Benchmark
+  def jacksonFromJsonBytes(state: BenchmarkState): MediaContent =
+    JsonCodecs.jacksonMapper.readValue(state.jsonBytes, classOf[MediaContent])
+
+  @Benchmark
+  def foryFromJsonString(state: BenchmarkState): MediaContent =
+    JsonCodecs.foryJson.fromJson(state.jsonString, classOf[MediaContent])
+
+  @Benchmark
+  def jsoniterFromJsonString(state: BenchmarkState): MediaContent =
+    readFromString[MediaContent](state.jsonString)
+
+  @Benchmark
+  def jacksonFromJsonString(state: BenchmarkState): MediaContent =
+    JsonCodecs.jacksonMapper.readValue(state.jsonString, classOf[MediaContent])
diff --git a/benchmarks/scala/src/main/resources/data/eishay.json b/benchmarks/scala/src/main/resources/data/eishay.json
new file mode 100644
index 000000000..a96a3a898
--- /dev/null
+++ b/benchmarks/scala/src/main/resources/data/eishay.json
@@ -0,0 +1,30 @@
+{"images": [{
+      "height":768,
+      "size":"LARGE",
+      "title":"Javaone Keynote",
+      "uri":"http://javaone.com/keynote_large.jpg",
+      "width":1024
+    }, {
+      "height":240,
+      "size":"SMALL",
+      "title":"Javaone Keynote",
+      "uri":"http://javaone.com/keynote_small.jpg",
+      "width":320
+    }
+  ],
+  "media": {
+    "bitrate":262144,
+    "duration":18000000,
+    "format":"video/mpg4",
+    "height":480,
+    "persons": [
+      "Bill Gates",
+      "Steve Jobs"
+    ],
+    "player":"JAVA",
+    "size":58982400,
+    "title":"Javaone Keynote",
+    "uri":"http://javaone.com/keynote.mpg",
+    "width":640
+  }
+}
diff --git a/benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/JsonCodecs.scala b/benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/JsonCodecs.scala
new file mode 100644
index 000000000..02545a3a9
--- /dev/null
+++ b/benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/JsonCodecs.scala
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.benchmark.json
+
+import com.fasterxml.jackson.annotation.JsonInclude
+import com.fasterxml.jackson.databind.ObjectMapper
+import com.fasterxml.jackson.module.scala.DefaultScalaModule
+import com.github.plokhotnyuk.jsoniter_scala.core.JsonValueCodec
+import com.github.plokhotnyuk.jsoniter_scala.macros.JsonCodecMaker
+import org.apache.fory.json.ForyJson
+import org.apache.fory.json.scala.ForyJsonScala
+
+object JsonCodecs:
+  val foryJson: ForyJson = ForyJsonScala.builder().build()
+
+  given JsonValueCodec[MediaContent] = JsonCodecMaker.make[MediaContent]
+
+  val jacksonMapper: ObjectMapper =
+    ObjectMapper()
+      .registerModule(DefaultScalaModule)
+      .setDefaultPropertyInclusion(JsonInclude.Include.NON_NULL)
+
+  def mediaContentEquals(left: MediaContent, right: MediaContent): Boolean =
+    left == right
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/MediaContent.scala
similarity index 58%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/MediaContent.scala
index 142362da2..665551e31 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/benchmarks/scala/src/main/scala/org/apache/fory/benchmark/json/MediaContent.scala
@@ -17,24 +17,30 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.benchmark.json
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
+case class MediaContent(media: Media, images: List[Image])
 
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
+case class Media(
+    uri: String = null,
+    title: String = null,
+    width: Int = 0,
+    height: Int = 0,
+    format: String = null,
+    duration: Long = 0L,
+    size: Long = 0L,
+    bitrate: Int = 0,
+    hasBitrate: Boolean = false,
+    persons: List[String],
+    player: String = null,
+    copyright: String = null,
+)
 
-  public String getId() {
-    return id;
-  }
-
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
-
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
-  }
-}
+case class Image(
+    uri: String = null,
+    title: String = null,
+    width: Int = 0,
+    height: Int = 0,
+    size: String = null,
+    media: Media = null,
+)
diff --git a/benchmarks/scala/src/test/scala/org/apache/fory/benchmark/json/MediaContentCodecSuite.scala b/benchmarks/scala/src/test/scala/org/apache/fory/benchmark/json/MediaContentCodecSuite.scala
new file mode 100644
index 000000000..7741d23ea
--- /dev/null
+++ b/benchmarks/scala/src/test/scala/org/apache/fory/benchmark/json/MediaContentCodecSuite.scala
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.benchmark.json
+
+import java.nio.charset.StandardCharsets
+
+import com.github.plokhotnyuk.jsoniter_scala.core.{readFromArray, readFromString, writeToArray, writeToString}
+
+class MediaContentCodecSuite extends munit.FunSuite:
+  import JsonCodecs.given
+
+  private val jsonString =
+    val stream = getClass.getClassLoader.getResourceAsStream("data/eishay.json")
+    try String(stream.readAllBytes(), StandardCharsets.UTF_8)
+    finally stream.close()
+  private val expected = readFromString[MediaContent](jsonString)
+
+  private def assertMediaContentEquals(actual: MediaContent): Unit =
+    assert(JsonCodecs.mediaContentEquals(actual, expected))
+
+  test("all codecs round trip MediaContent"):
+    val foryString = JsonCodecs.foryJson.toJson(expected)
+    val foryBytes = JsonCodecs.foryJson.toJsonBytes(expected)
+    assertMediaContentEquals(JsonCodecs.foryJson.fromJson(foryString, classOf[MediaContent]))
+    assertMediaContentEquals(JsonCodecs.foryJson.fromJson(foryBytes, classOf[MediaContent]))
+
+    assertMediaContentEquals(readFromString[MediaContent](writeToString(expected)))
+    assertMediaContentEquals(readFromArray[MediaContent](writeToArray(expected)))
+
+    val jacksonString = JsonCodecs.jacksonMapper.writeValueAsString(expected)
+    val jacksonBytes = JsonCodecs.jacksonMapper.writeValueAsBytes(expected)
+    assertMediaContentEquals(JsonCodecs.jacksonMapper.readValue(jacksonString, classOf[MediaContent]))
+    assertMediaContentEquals(JsonCodecs.jacksonMapper.readValue(jacksonBytes, classOf[MediaContent]))
diff --git a/benchmarks/scala/test_plot_json_benchmark.py b/benchmarks/scala/test_plot_json_benchmark.py
new file mode 100644
index 000000000..c014565e6
--- /dev/null
+++ b/benchmarks/scala/test_plot_json_benchmark.py
@@ -0,0 +1,88 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+import sys
+import unittest
+from pathlib import Path
+
+sys.path.insert(0, str(Path(__file__).resolve().parent))
+
+import plot_json_benchmark
+import run_json_benchmark
+
+
+class ScalaJsonPlotTest(unittest.TestCase):
+    def test_collects_three_bars_for_every_case(self) -> None:
+        benchmarks = []
+        for representation in ("String", "Bytes"):
+            for operation in ("To", "From"):
+                for index, serializer in enumerate(("fory", "jsoniter", "jackson"), 1):
+                    benchmarks.append(
+                        {
+                            "benchmark": f"suite.{serializer}{operation}Json{representation}",
+                            "primaryMetric": {
+                                "score": index,
+                                "scoreError": 0,
+                                "scoreUnit": "ops/ms",
+                            },
+                        }
+                    )
+        results = plot_json_benchmark.collect_results(benchmarks)
+        self.assertEqual(len(results[("to", "string")]), 3)
+        self.assertEqual(results[("from", "bytes")]["jackson"][0], 3_000)
+
+    def test_alternating_median(self) -> None:
+        self.assertEqual(
+            run_json_benchmark.alternating_order(1),
+            ("jsoniter", "jackson", "fory"),
+        )
+        trials = []
+        for score in (10.0, 30.0, 20.0):
+            trial = []
+            for representation in ("String", "Bytes"):
+                for operation in ("To", "From"):
+                    for serializer in ("fory", "jsoniter", "jackson"):
+                        trial.append(
+                            {
+                                "benchmark": (
+                                    f"suite.{serializer}{operation}Json{representation}"
+                                ),
+                                "primaryMetric": {
+                                    "score": score,
+                                    "scoreError": 1.0,
+                                    "scoreConfidence": [score - 1.0, score + 1.0],
+                                    "scorePercentiles": {"50.0": score},
+                                    "rawData": [[score]],
+                                    "scoreUnit": "ops/s",
+                                },
+                            }
+                        )
+            trials.append(trial)
+        results = run_json_benchmark.aggregate_results(trials, 3)
+        self.assertEqual(len(results), 12)
+        self.assertTrue(
+            all(result["primaryMetric"]["score"] == 20.0 for result in results)
+        )
+        for result in results:
+            metric = result["primaryMetric"]
+            self.assertNotIn("rawData", metric)
+            self.assertNotIn("scoreConfidence", metric)
+            self.assertNotIn("scorePercentiles", metric)
+
+
+if __name__ == "__main__":
+    unittest.main()
diff --git a/ci/release.py b/ci/release.py
index 258836eeb..aad936b52 100644
--- a/ci/release.py
+++ b/ci/release.py
@@ -57,7 +57,8 @@ MAVEN_RELEASE_CMD = (
 )
 SCALA_RELEASE_CMDS = (
     "sbt clean",
-    "sbt +publishSigned",
+    "sbt 'project fory-scala' +publishSigned",
+    "sbt 'project fory-json-scala' +publishSigned",
     "sbt sonatypePrepare",
     "sbt sonatypeBundleUpload",
 )
@@ -67,6 +68,8 @@ RELEASE_DOC_ROOTS = (
     "java/fory-json/README.md",
     "rust/README.md",
     "scala/README.md",
+    "scala/fory-scala/README.md",
+    "scala/fory-json-scala/README.md",
     "csharp/README.md",
     "swift/README.md",
     "dart/packages/fory/README.md",
diff --git a/ci/test_release.py b/ci/test_release.py
index f06acf3bb..e34809152 100644
--- a/ci/test_release.py
+++ b/ci/test_release.py
@@ -16,6 +16,7 @@
 # under the License.
 
 import unittest
+from unittest import mock
 
 if __package__:
     from . import release
@@ -38,6 +39,7 @@ class ReleaseDocVersionTest(unittest.TestCase):
             '    .package(url: "https://github.com/apache/fory.git", exact: "1.5.0")\n',
             'implementation("org.apache.fory:fory-core:1.5.0")\n',
             'libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.5.0"\n',
+            'libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.5.0"\n',
             'implementation("io.grpc:grpc-api:1.73.0")\n',
             "The wire format was introduced in version 1.5.0.\n",
         ]
@@ -54,6 +56,7 @@ class ReleaseDocVersionTest(unittest.TestCase):
             '    .package(url: "https://github.com/apache/fory.git", exact: "1.6.0")\n',
             'implementation("org.apache.fory:fory-core:1.6.0")\n',
             'libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.6.0"\n',
+            'libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.6.0"\n',
             'implementation("io.grpc:grpc-api:1.73.0")\n',
             "The wire format was introduced in version 1.5.0.\n",
         ]
@@ -64,5 +67,22 @@ class ReleaseDocVersionTest(unittest.TestCase):
         self.assertEqual(expected, release._update_release_doc_lines(updated, "1.6.0"))
 
 
+class ScalaReleaseTest(unittest.TestCase):
+    @mock.patch.object(release, "_run_release_cmd")
+    def test_publishes_each_module(self, run_release_cmd):
+        release._publish_scala()
+
+        self.assertEqual(
+            [
+                mock.call("sbt clean", "scala"),
+                mock.call("sbt 'project fory-scala' +publishSigned", "scala"),
+                mock.call("sbt 'project fory-json-scala' +publishSigned", "scala"),
+                mock.call("sbt sonatypePrepare", "scala"),
+                mock.call("sbt sonatypeBundleUpload", "scala"),
+            ],
+            run_release_cmd.call_args_list,
+        )
+
+
 if __name__ == "__main__":
     unittest.main()
diff --git a/docs/benchmarks/json/scala/README.md b/docs/benchmarks/json/scala/README.md
new file mode 100644
index 000000000..d57609965
--- /dev/null
+++ b/docs/benchmarks/json/scala/README.md
@@ -0,0 +1,41 @@
+# Scala JSON Benchmark Report
+
+The benchmark compares fory-json-scala, jsoniter-scala, and Jackson Scala on the same immutable Scala MediaContent model and Eishay JSON document. The String group excludes UTF-8 conversion; every library in the UTF-8 group uses its direct byte-array API.
+
+- Benchmark date: `2026-08-14`
+- Source commit: `588ad6ab355c4c23fa0a2e4f269a8c733cba7b01`
+- Platform: macOS-15.7.2-arm64-arm-64bit (arm64)
+- JDK: `26.0.1`
+- VM: `OpenJDK 64-Bit Server VM`
+- JMH: `1.37`
+- Warmup: 2 iterations × `1 s`
+- Measurement: 2 iterations × `1 s`
+- Forks: 1; threads: 1
+- Aggregation: median of 3 alternating short runs; error bars show the maximum cross-run deviation
+- Mode: throughput; higher is better
+
+## String
+
+![Scala JSON String benchmark throughput](string_throughput.png)
+
+## UTF-8 Bytes
+
+![Scala JSON UTF-8 bytes benchmark throughput](utf8_bytes_throughput.png)
+
+## Results
+
+| Representation | Operation   | fory-json-scala ops/sec | jsoniter-scala ops/sec | Jackson Scala ops/sec | Fastest         |
+| -------------- | ----------- | ----------------------: | ---------------------: | --------------------: | --------------- |
+| String         | Serialize   |               6,760,588 |              2,748,997 |             1,955,855 | fory-json-scala |
+| String         | Deserialize |               3,771,280 |              2,350,297 |               960,362 | fory-json-scala |
+| UTF-8 bytes    | Serialize   |               9,485,122 |              2,745,567 |             1,761,719 | fory-json-scala |
+| UTF-8 bytes    | Deserialize |               3,318,893 |              2,391,923 |             1,080,453 | fory-json-scala |
+
+## Fory performance advantage
+
+| Representation | Operation   | vs jsoniter-scala | vs Jackson Scala |
+| -------------- | ----------- | ----------------: | ---------------: |
+| String         | Serialize   |            145.9% |           245.7% |
+| String         | Deserialize |             60.5% |           292.7% |
+| UTF-8 bytes    | Serialize   |            245.5% |           438.4% |
+| UTF-8 bytes    | Deserialize |             38.8% |           207.2% |
diff --git a/docs/benchmarks/json/scala/benchmark_results.json b/docs/benchmarks/json/scala/benchmark_results.json
new file mode 100644
index 000000000..ac7edac58
--- /dev/null
+++ b/docs/benchmarks/json/scala/benchmark_results.json
@@ -0,0 +1,350 @@
+[
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.foryFromJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 3318893.391568216,
+      "scoreError": 38387.28448699275,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.foryFromJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 3771279.877394124,
+      "scoreError": 24022.44981324859,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.foryToJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 9485122.241809543,
+      "scoreError": 389806.29923327826,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.foryToJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 6760588.439072061,
+      "scoreError": 54595.97697333433,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jacksonFromJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 1080452.8479462112,
+      "scoreError": 24089.40104978718,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jacksonFromJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 960361.5901450468,
+      "scoreError": 8161.349699108629,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jacksonToJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 1761718.933247129,
+      "scoreError": 34735.119977300055,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jacksonToJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 1955854.87305796,
+      "scoreError": 37257.23058240209,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jsoniterFromJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 2391923.4543758444,
+      "scoreError": 181924.61893445626,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jsoniterFromJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 2350296.6557386126,
+      "scoreError": 127256.9665232785,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jsoniterToJsonBytes",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 2745567.0435188385,
+      "scoreError": 1391488.088001239,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  },
+  {
+    "jmhVersion": "1.37",
+    "benchmark": "org.apache.fory.benchmark.json.MediaContentBenchmark.jsoniterToJsonString",
+    "mode": "thrpt",
+    "threads": 1,
+    "forks": 1,
+    "jvm": "/opt/homebrew/Cellar/openjdk/26.0.1/libexec/openjdk.jdk/Contents/Home/bin/java",
+    "jvmArgs": [
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED",
+      "--add-opens=java.base/java.lang.invoke=ALL-UNNAMED"
+    ],
+    "jdkVersion": "26.0.1",
+    "vmName": "OpenJDK 64-Bit Server VM",
+    "vmVersion": "26.0.1",
+    "warmupIterations": 2,
+    "warmupTime": "1 s",
+    "warmupBatchSize": 1,
+    "measurementIterations": 2,
+    "measurementTime": "1 s",
+    "measurementBatchSize": 1,
+    "primaryMetric": {
+      "score": 2748996.506356555,
+      "scoreError": 37852.358972850256,
+      "scoreUnit": "ops/s"
+    },
+    "secondaryMetrics": {},
+    "alternatingRounds": 3,
+    "aggregation": "median"
+  }
+]
diff --git a/docs/benchmarks/json/scala/string_throughput.png b/docs/benchmarks/json/scala/string_throughput.png
new file mode 100644
index 000000000..039b20e9a
Binary files /dev/null and b/docs/benchmarks/json/scala/string_throughput.png differ
diff --git a/docs/benchmarks/json/scala/utf8_bytes_throughput.png b/docs/benchmarks/json/scala/utf8_bytes_throughput.png
new file mode 100644
index 000000000..d54937406
Binary files /dev/null and b/docs/benchmarks/json/scala/utf8_bytes_throughput.png differ
diff --git a/docs/json/android.md b/docs/json/android.md
index 54488f556..33bea7ad0 100644
--- a/docs/json/android.md
+++ b/docs/json/android.md
@@ -1,6 +1,6 @@
 ---
 title: Android
-sidebar_position: 6
+sidebar_position: 8
 id: android
 license: |
   Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/json/graalvm.md b/docs/json/graalvm.md
index 8c01c2831..f4d96d0cc 100644
--- a/docs/json/graalvm.md
+++ b/docs/json/graalvm.md
@@ -1,6 +1,6 @@
 ---
 title: GraalVM Native Image
-sidebar_position: 7
+sidebar_position: 9
 id: graalvm
 license: |
   Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/json/index.md b/docs/json/index.md
index 9e6dc17ed..fe8438ac2 100644
--- a/docs/json/index.md
+++ b/docs/json/index.md
@@ -19,9 +19,9 @@ license: |
   limitations under the License.
 ---
 
-Fory JSON is Apache Fory's thread-safe Java JSON codec. It provides interpreted and
+Fory JSON is Apache Fory's thread-safe JSON codec for Java and Scala. It provides interpreted and
 runtime-generated codecs for Java objects, records, immutable creator-based classes, common JDK
-types, generic containers, and custom complete-value codecs.
+types, generic containers, Scala models and collections, and custom complete-value codecs.
 
 Fory JSON is a separate data format from Fory's binary native and xlang protocols. Use it when a
 system must exchange ordinary JSON with browsers, APIs, logs, configuration, or another JSON
@@ -36,6 +36,8 @@ reference identity, circular graphs, or Fory's binary-only features.
 | Understand Java object mapping and configuration               | [Object Mapping](object-mapping.md)   |
 | Configure properties, creators, values, validators, and mixins | [Annotations](annotations.md)         |
 | Extend complete values, children, and map keys                 | [Custom Codecs](custom-codecs.md)     |
+| Package and distribute reusable JSON extensions                | [Modules](modules.md)                 |
+| Use case classes, Scala collections, and Scala enums           | [Scala](scala.md)                     |
 | Deploy on Android                                              | [Android](android.md)                 |
 | Build a GraalVM native image                                   | [GraalVM Native Image](graalvm.md)    |
 | Decode input safely                                            | [Security](security.md)               |
diff --git a/docs/json/modules.md b/docs/json/modules.md
new file mode 100644
index 000000000..0e573b8ef
--- /dev/null
+++ b/docs/json/modules.md
@@ -0,0 +1,107 @@
+---
+title: Modules
+sidebar_position: 6
+id: modules
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+`ForyJsonModule` packages a coherent set of Fory JSON registrations into one reusable extension.
+A module can be provided by a language integration, a third-party library, a framework, or an
+application. Use a module when consumers should install the whole extension with one builder call;
+use direct builder registration for an application-specific codec that does not need separate
+distribution.
+
+## Creating and Installing a Module
+
+After implementing a codec such as `MoneyCodec` from the
+[Custom Codecs guide](custom-codecs.md), a library can distribute its registration as a module:
+
+```java
+import org.apache.fory.json.ForyJson;
+import org.apache.fory.json.ForyJsonModule;
+import org.apache.fory.json.ModuleContext;
+
+public final class MoneyJsonModule implements ForyJsonModule {
+  public static final MoneyJsonModule INSTANCE = new MoneyJsonModule();
+
+  private MoneyJsonModule() {}
+
+  @Override
+  public void install(ModuleContext context) {
+    context.registerCodec(Money.class, new MoneyCodec());
+  }
+}
+
+ForyJson json =
+    ForyJson.builder()
+        .withModule(MoneyJsonModule.INSTANCE)
+        .build();
+```
+
+Installation runs while `build()` creates the immutable runtime configuration. Treat a module
+configuration as immutable after adding it to a builder. Registered codec instances are shared by
+concurrent operations and must be thread-safe.
+
+## Module Registrations
+
+`ModuleContext` exposes the registrations needed by reusable integrations:
+
+| Registration                             | Use                                                      |
+| ---------------------------------------- | -------------------------------------------------------- |
+| `registerCodec(Class, JsonValueCodec)`   | One shared complete codec for an exact class             |
+| `registerCodec(Class, JsonCodecFactory)` | A resolver-owned complete codec for an exact class       |
+| `registerMixin(Class)`                   | An annotated Mixin for its declared target               |
+| `registerCodecFactory(JsonCodecFactory)` | A codec family selected from a parameterized target type |
+
+Codec implementations and `JsonCodecFactory` behavior are documented in
+[Custom Codecs](custom-codecs.md). Modules only package those registrations for installation.
+
+Application registrations made directly on `ForyJsonBuilder` take precedence over module exact
+registrations. Conflicting module registrations fail during `build()` instead of depending on
+installation order.
+
+## Module Identity
+
+`moduleKey()` identifies the module configuration for generated-code reuse and conflict checking.
+The default key is the module class name and is sufficient for a configuration-free module.
+
+A configurable module must return a deterministic key that includes every option affecting codec
+selection or generated code. Do not include secrets, mutable process state, or values unrelated to
+the installed JSON behavior.
+
+```java
+public final class ConfiguredJsonModule implements ForyJsonModule {
+  private final boolean compactNames;
+
+  public ConfiguredJsonModule(boolean compactNames) {
+    this.compactNames = compactNames;
+  }
+
+  @Override
+  public String moduleKey() {
+    return getClass().getName() + ":compactNames=" + compactNames;
+  }
+
+  @Override
+  public void install(ModuleContext context) {
+    // Register the codecs, factories, or Mixins selected by this configuration.
+  }
+}
+```
+
+For a Scala example that packages derived third-party enum codecs in a module, see
+[Packaging Derived Codecs in a Module](scala.md#packaging-derived-codecs-in-a-module).
diff --git a/docs/json/scala.md b/docs/json/scala.md
new file mode 100644
index 000000000..06218c0c4
--- /dev/null
+++ b/docs/json/scala.md
@@ -0,0 +1,214 @@
+---
+title: Scala
+sidebar_position: 7
+id: scala
+license: |
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+---
+
+Fory JSON supports Scala 2.13 and Scala 3 through the optional `fory-json-scala` artifact. The
+module works on the ordinary JVM and GraalVM Native Image. Android is not supported.
+
+## Setup
+
+```sbt
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.0-SNAPSHOT"
+```
+
+`ForyJsonScala.builder()` installs the Scala module and returns the standard Fory JSON builder:
+
+```scala
+import org.apache.fory.json.scala.ForyJsonScala
+
+case class Person(name: String, age: Int = 18, aliases: List[String] = Nil)
+
+val json = ForyJsonScala.builder().build()
+val text = json.toJson(Person("Ada"))
+val person = json.fromJson(text, classOf[Person])
+```
+
+Reuse the resulting `ForyJson` instance. It is immutable and thread-safe after construction.
+
+## Case classes and annotations
+
+Case classes are decoded by calling their full primary constructor. Fory invokes Scala's generated
+constructor-default methods for missing defaulted parameters; it does not parse default expressions
+or mutate constructor `val` fields. Defaults in later parameter lists receive the preceding
+constructor arguments exactly as Scala defines them. A missing parameter without a default is an
+error. Mutable body properties are applied after construction.
+
+Fory JSON annotations can be placed directly on Scala constructor properties:
+
+```scala
+import org.apache.fory.json.annotation.{JsonCodec, JsonIgnore, JsonProperty}
+
+case class Media(
+    @JsonProperty("media_uri") uri: String,
+    @JsonIgnore internalId: String = "hidden",
+    @JsonCodec(elementCodec = classOf[TagCodec]) tags: List[Tag] = Nil,
+    @JsonProperty(include = JsonProperty.Include.NON_NULL) title: String = null
+)
+```
+
+`JsonIgnore` applies to fields, property methods, setter parameters, and selected constructor
+parameters. `JsonCodec` child slots bind direct collection elements, `Option` content, and map keys
+or values. All other Fory JSON annotations retain the behavior described in
+[Annotations](annotations.md).
+
+If a required non-defaulted reference parameter uses an inclusion rule that would omit `null`,
+serialization rejects a null value. This guarantees that JSON written by Fory remains readable by
+the same case-class schema.
+
+## Supported Scala types
+
+| Scala type                                                  | JSON representation                                    |
+| ----------------------------------------------------------- | ------------------------------------------------------ |
+| `Unit`                                                      | `null`                                                 |
+| case class                                                  | object                                                 |
+| singleton object                                            | empty object                                           |
+| value class                                                 | underlying value                                       |
+| `Option[A]`, `Some[A]`, `None`                              | contained value or `null`                              |
+| `Either[L, R]`                                              | object containing exactly one `left` or `right` member |
+| `List`, `Seq`, `Vector`, `Queue`, `ArraySeq`, buffers, sets | array                                                  |
+| Scala maps, `IntMap`, `LongMap`                             | object                                                 |
+| immutable and mutable `BitSet`                              | ascending integer array                                |
+| `Tuple1` through `Tuple22`                                  | fixed-length array                                     |
+| Scala 3 `EmptyTuple`                                        | empty array                                            |
+| `BigInt`, `BigDecimal`                                      | JSON number                                            |
+| Scala `StringBuilder`                                       | string                                                 |
+| `Range`, supported `NumericRange`                           | realized value array                                   |
+| `FiniteDuration`, `Duration`                                | fixed `length`/`unit` or `special` object              |
+| parameterless Scala 3 enum                                  | string case name                                       |
+| Scala 2 `Enumeration`                                       | string through an owner-bound codec                    |
+
+Strict standard-library collections are reconstructed through their standard Scala builders.
+Fory does not add a Scala-specific collection-size limit; the codecs use the same input-length,
+depth, graph-memory, and read-progress limits as Fory JSON core. A sparse `BitSet` whose highest
+index would require backing storage disproportionate to the available JSON input is rejected.
+
+Lazy or process-local values are intentionally unsupported by the default module, including
+`LazyList`, `Stream`, views, iterators, collection builders, `Try`, `Throwable`, `Future`, `Promise`,
+`ExecutionContext`, `Deadline`, functions, reflection/compiler metadata, and regex values. Sorted
+or custom collections need an exact application codec because their ordering or construction is
+application configuration.
+
+## Parameterized types
+
+Use a complete `TypeRef` when reading a parameterized Scala type:
+
+```scala
+import org.apache.fory.reflect.TypeRef
+
+val typeRef = new TypeRef[Map[String, Option[Int]]]() {}
+val value = json.fromJson("{\"count\":1}", typeRef)
+```
+
+Scala value-type arguments can erase to `Object` in a normal JVM signature. `ScalaTypeRef` is a
+compile-time type-token constructor that preserves those arguments on Scala 2.13 and Scala 3:
+
+```scala
+import org.apache.fory.json.scala.ScalaTypeRef
+
+val rangeType = ScalaTypeRef[scala.collection.immutable.NumericRange[Int]]
+val range = json.fromJson("[1,3,5,7]", rangeType)
+```
+
+`Some[Int]` is a valid declared type when supplied with its complete type argument. A non-null JSON
+value decodes to `Some(value)`; JSON `null` is rejected for `Some[Int]` but decodes to `None` for
+`Option[Int]`.
+
+## Scala 2 Enumeration
+
+Scala 2 erases the owning `Enumeration` from `Enumeration#Value`. Bind the owner explicitly with
+`ScalaEnumerationCodec` and select it through an annotation:
+
+```scala
+object Weekday extends Enumeration {
+  val Monday, Tuesday = Value
+}
+
+final class WeekdayCodec extends ScalaEnumerationCodec(Weekday)
+
+case class Schedule(
+    @JsonCodec(value = classOf[WeekdayCodec]) day: Weekday.Value,
+    @JsonCodec(elementCodec = classOf[WeekdayCodec]) days: List[Weekday.Value]
+)
+```
+
+The codec also implements the map-key contract, so its class can be used in `keyCodec`.
+
+## Scala 3 closed enums
+
+A parameterless Scala 3 enum uses its case name as a JSON string. Add `derives ScalaJsonCodec` to an
+enum with parameterized cases to define one closed wrapper-object representation for every case:
+
+```scala
+import org.apache.fory.json.scala.*
+
+enum Result derives ScalaJsonCodec {
+  case Ok(value: String)
+  case Error(code: Int)
+  case Pending
+}
+
+val json = ForyJsonScala.builder().build()
+```
+
+The values above use `{"Ok":{"value":"ready"}}`, `{"Error":{"code":7}}`, and
+`{"Pending":{}}`. The reader never accepts a class name or chooses a subtype from runtime
+reflection. For a third-party enum that cannot add `derives`, derive and register its schema at the
+builder call site:
+
+```scala
+val json = ForyJsonScala.builder().register[thirdparty.Result].build()
+```
+
+### Packaging Derived Codecs in a Module
+
+A library that supports several third-party Scala 3 enums can package their derived codecs in a
+reusable module:
+
+```scala
+import org.apache.fory.json.{ForyJsonModule, ModuleContext}
+import org.apache.fory.json.scala.*
+
+object ThirdPartyJsonModule extends ForyJsonModule:
+  override def install(context: ModuleContext): Unit =
+    context.registerCodec(
+      classOf[thirdparty.Result],
+      ScalaJsonCodec.derived[thirdparty.Result]
+    )
+
+val json =
+  ForyJsonScala.builder()
+    .withModule(ThirdPartyJsonModule)
+    .build()
+```
+
+The derivation is compiled as part of the module, so consumers only install the compiled module.
+This is the reusable equivalent of calling `register[thirdparty.Result]` on one builder.
+
+Modules are installed explicitly with `withModule`. Fory JSON does not scan the classpath or invoke
+modules through `ServiceLoader`; explicit installation keeps the enabled codecs deterministic and
+prevents an unrelated dependency from changing deserialization behavior. See
+[Modules](modules.md) for the general module API and registration rules.
+
+## GraalVM Native Image
+
+The Scala module uses the same build-time module registration on the JVM and in a native image.
+Application models, custom codecs, and derived enum schemas must be reachable when the native image
+is built. Generate Fory codecs as part of the native-image build rather than adding general
+reflection configuration. No Scala compiler, TASTy reader, or runtime macro execution is required.
diff --git a/docs/json/security.md b/docs/json/security.md
index 0e9fb91e0..1c6580a9d 100644
--- a/docs/json/security.md
+++ b/docs/json/security.md
@@ -1,6 +1,6 @@
 ---
 title: Security
-sidebar_position: 8
+sidebar_position: 10
 id: security
 license: |
   Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/docs/json/troubleshooting.md b/docs/json/troubleshooting.md
index 70196c19e..3315d59fc 100644
--- a/docs/json/troubleshooting.md
+++ b/docs/json/troubleshooting.md
@@ -1,6 +1,6 @@
 ---
 title: Troubleshooting
-sidebar_position: 9
+sidebar_position: 11
 id: troubleshooting
 license: |
   Licensed to the Apache Software Foundation (ASF) under one or more
diff --git a/java/fory-json/README.md b/java/fory-json/README.md
index 335ca51ae..442aaa0bc 100644
--- a/java/fory-json/README.md
+++ b/java/fory-json/README.md
@@ -177,6 +177,7 @@ The canonical Fory JSON documentation is split by reader task:
 - [Object Mapping](../../docs/json/object-mapping.md)
 - [Annotations](../../docs/json/annotations.md)
 - [Custom Codecs](../../docs/json/custom-codecs.md)
+- [Modules](../../docs/json/modules.md)
 - [Android](../../docs/json/android.md)
 - [GraalVM Native Image](../../docs/json/graalvm.md)
 - [Security](../../docs/json/security.md)
@@ -191,6 +192,9 @@ closed polymorphism, and dynamic members. See the
 complete value or one direct child level. See
 [Custom Codecs](../../docs/json/custom-codecs.md).
 
+`ForyJsonModule` packages codecs, factories, and Mixins for installation by a language integration,
+third-party library, framework, or application. See [Modules](../../docs/json/modules.md).
+
 Android uses interpreted or annotation-processor-generated access with exact R8
 rules. See the [Android guide](../../docs/json/android.md).
 
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/ForyJson.java b/java/fory-json/src/main/java/org/apache/fory/json/ForyJson.java
index 16e2b264d..baecb0cb8 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/ForyJson.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/ForyJson.java
@@ -728,6 +728,8 @@ public final class ForyJson {
     private final Latin1JsonReader latin1Reader;
     private final Utf16JsonReader utf16Reader;
     private byte[] charBackedUtf16Bytes;
+    private Class<?> lastRuntimeRootType;
+    private JsonTypeInfo lastRuntimeRootInfo;
     private Type lastRootType;
     private Class<?> lastRootFallback;
     private JsonTypeInfo lastRootInfo;
@@ -791,7 +793,14 @@ public final class ForyJson {
     }
 
     private JsonTypeInfo rootTypeInfo(Class<?> type) {
-      return rootTypeInfo(type, type);
+      JsonTypeInfo typeInfo = lastRuntimeRootInfo;
+      if (lastRuntimeRootType == type && typeInfo != null) {
+        return typeInfo;
+      }
+      typeInfo = typeResolver.getRuntimeTypeInfo(type);
+      lastRuntimeRootType = type;
+      lastRuntimeRootInfo = typeInfo;
+      return typeInfo;
     }
 
     private JsonTypeInfo rootTypeInfo(Type type, Class<?> fallback) {
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonBuilder.java b/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonBuilder.java
index ee1472c3d..1a5a98ecb 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonBuilder.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonBuilder.java
@@ -19,7 +19,9 @@
 
 package org.apache.fory.json;
 
+import java.util.ArrayList;
 import java.util.IdentityHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import org.apache.fory.json.annotation.JsonMixin;
@@ -60,6 +62,8 @@ public final class ForyJsonBuilder {
   private JsonTypeChecker typeChecker;
   private final CodecRegistry codecRegistry = new CodecRegistry();
   private final Map<Class<?>, Class<?>> mixins = new IdentityHashMap<>();
+  private final List<ForyJsonModule> modules = new ArrayList<>();
+  private final IdentityHashMap<ForyJsonModule, Boolean> moduleIdentities = new IdentityHashMap<>();
 
   ForyJsonBuilder() {}
 
@@ -212,6 +216,21 @@ public final class ForyJsonBuilder {
     return this;
   }
 
+  /** Registers a resolver-owned complete codec factory for one exact class. */
+  public <T> ForyJsonBuilder registerCodec(Class<T> type, JsonCodecFactory factory) {
+    codecRegistry.registerFactory(type, factory);
+    return this;
+  }
+
+  /** Adds an immutable JSON module to this builder. Repeating the same instance is ignored. */
+  public ForyJsonBuilder withModule(ForyJsonModule module) {
+    Objects.requireNonNull(module, "module");
+    if (moduleIdentities.put(module, Boolean.TRUE) == null) {
+      modules.add(module);
+    }
+    return this;
+  }
+
   /**
    * Registers the JSON Mixin declared by {@code mixinType} for its exact target class.
    *
@@ -225,26 +244,7 @@ public final class ForyJsonBuilder {
    *     declaration
    */
   public ForyJsonBuilder registerMixin(Class<?> mixinType) {
-    Objects.requireNonNull(mixinType, "mixinType");
-    JsonMixin declaration;
-    try {
-      declaration = mixinType.getDeclaredAnnotation(JsonMixin.class);
-    } catch (RuntimeException | LinkageError e) {
-      throw new IllegalArgumentException(
-          "Cannot read JSON Mixin declaration " + mixinType.getName(), e);
-    }
-    if (declaration == null) {
-      throw new IllegalArgumentException(
-          "JSON Mixin source is missing @JsonMixin: " + mixinType.getName());
-    }
-    Class<?> target;
-    try {
-      target = declaration.target();
-    } catch (RuntimeException | LinkageError e) {
-      throw new IllegalArgumentException(
-          "Cannot resolve JSON Mixin target for " + mixinType.getName(), e);
-    }
-    mixins.put(target, mixinType);
+    mixins.put(ModuleInstaller.mixinTarget(mixinType), mixinType);
     return this;
   }
 
@@ -271,6 +271,8 @@ public final class ForyJsonBuilder {
     boolean effectiveCodegen = codegenEnabled && !AndroidSupport.IS_ANDROID;
     boolean effectiveAsyncCompilation =
         asyncCompilationEnabled && effectiveCodegen && !GraalvmSupport.IN_GRAALVM_NATIVE_IMAGE;
+    ModuleInstaller.InstalledModules installed =
+        ModuleInstaller.install(new ArrayList<>(modules), codecRegistry, mixins);
     return new ForyJson(
         new JsonConfig(
             writeNullFields,
@@ -284,8 +286,11 @@ public final class ForyJsonBuilder {
             maxGraphMemoryBytes,
             concurrencyLevel,
             bufferSizeLimitBytes,
-            codecRegistry,
-            mixins,
+            installed.codecs,
+            installed.mixins,
+            installed.factories,
+            installed.moduleIdentities,
+            installed.factoryIdentities,
             typeChecker));
   }
 }
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonModule.java
similarity index 57%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to java/fory-json/src/main/java/org/apache/fory/json/ForyJsonModule.java
index 142362da2..fd5161a00 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/ForyJsonModule.java
@@ -17,24 +17,20 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json;
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
-
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
-
-  public String getId() {
-    return id;
+/** Installs one immutable set of JSON codecs while a {@link ForyJson} runtime is built. */
+public interface ForyJsonModule {
+  /**
+   * Returns the deterministic semantic identity of this module configuration.
+   *
+   * <p>A configurable module must override this method and include every setting that can change
+   * codec selection or generated source. The key must not contain secrets or process-local state.
+   */
+  default String moduleKey() {
+    return getClass().getName();
   }
 
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
-
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
-  }
+  /** Installs this module's immutable codec registrations. */
+  void install(ModuleContext context);
 }
diff --git a/scala/src/test/java/org/apache/fory/util/LombokDefaultLikeJavaClass.java b/java/fory-json/src/main/java/org/apache/fory/json/JsonCodecFactory.java
similarity index 52%
copy from scala/src/test/java/org/apache/fory/util/LombokDefaultLikeJavaClass.java
copy to java/fory-json/src/main/java/org/apache/fory/json/JsonCodecFactory.java
index 177f269a3..cbc24cd90 100644
--- a/scala/src/test/java/org/apache/fory/util/LombokDefaultLikeJavaClass.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/JsonCodecFactory.java
@@ -17,45 +17,29 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json;
 
 import java.util.Collections;
 import java.util.List;
+import org.apache.fory.annotation.Internal;
+import org.apache.fory.json.codec.JsonValueCodec;
+import org.apache.fory.json.resolver.JsonTypeResolver;
+import org.apache.fory.reflect.TypeRef;
 
-public class LombokDefaultLikeJavaClass {
-  private String id;
-  private List<String> imageRelations;
+/** Creates a complete JSON codec during a resolver-owned cold type lookup. */
+@FunctionalInterface
+public interface JsonCodecFactory {
+  /** Returns a codec for {@code type}, or {@code null} when this factory does not own it. */
+  JsonValueCodec<?> create(TypeRef<?> type, JsonTypeResolver resolver);
 
-  public LombokDefaultLikeJavaClass() {
-    this(null, Collections.emptyList());
+  /** Returns the deterministic semantic identity of this factory configuration. */
+  default String factoryKey() {
+    return getClass().getName();
   }
 
-  public LombokDefaultLikeJavaClass(String id, List<String> imageRelations) {
-    this.id = id;
-    this.imageRelations = imageRelations;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public List<String> getImageRelations() {
-    return imageRelations;
-  }
-
-  private static List<String> $default$imageRelations() {
-    return Collections.emptyList();
-  }
-
-  private static List<String> $default$1() {
-    return Collections.emptyList();
-  }
-
-  private List<String> $default$2() {
-    return Collections.emptyList();
-  }
-
-  private static List<String> $default$99() {
+  /** Returns runtime classes represented by an exact closed root codec. */
+  @Internal
+  default List<Class<?>> handledRuntimeClasses() {
     return Collections.emptyList();
   }
 }
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/JsonConfig.java b/java/fory-json/src/main/java/org/apache/fory/json/JsonConfig.java
index bca949cc9..1bd980d08 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/JsonConfig.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/JsonConfig.java
@@ -58,6 +58,8 @@ public final class JsonConfig {
   private final int bufferSizeLimitBytes;
   private final CodecRegistry codecRegistry;
   private final Map<Class<?>, Class<?>> mixins;
+  private final JsonCodecFactory[] codecFactories;
+  private final String[] codecFactoryIdentities;
   private final JsonTypeChecker typeChecker;
   private final JsonTypeCheckContext typeCheckContext;
   private final JsonCodegenKey codegenKey;
@@ -77,6 +79,9 @@ public final class JsonConfig {
       int bufferSizeLimitBytes,
       CodecRegistry codecRegistry,
       Map<Class<?>, Class<?>> mixins,
+      JsonCodecFactory[] codecFactories,
+      List<String> moduleIdentities,
+      List<String> factoryIdentities,
       JsonTypeChecker typeChecker) {
     this.writeNullFields = writeNullFields;
     this.codegenEnabled = codegenEnabled;
@@ -94,9 +99,14 @@ public final class JsonConfig {
     this.bufferSizeLimitBytes = bufferSizeLimitBytes;
     this.codecRegistry = codecRegistry.copy();
     this.mixins = immutableMixins(mixins);
+    this.codecFactories = codecFactories.clone();
+    this.codecFactoryIdentities = factoryIdentities.toArray(new String[0]);
     this.typeChecker = typeChecker;
     typeCheckContext = new JsonTypeCheckContext();
-    String codecRegistryKey = this.codecRegistry.codegenKey();
+    String codecRegistryKey =
+        this.codecRegistry.codegenKey()
+            + identityKey("module", moduleIdentities)
+            + identityKey("factory", factoryIdentities);
     codegenKey =
         new JsonCodegenKey(
             writeNullFields,
@@ -170,6 +180,18 @@ public final class JsonConfig {
     return codecRegistry;
   }
 
+  /** Returns the immutable cold-path codec factory snapshot. */
+  @Internal
+  public JsonCodecFactory[] codecFactories() {
+    return codecFactories.clone();
+  }
+
+  /** Returns identities parallel to {@link #codecFactories()}. */
+  @Internal
+  public String[] codecFactoryIdentities() {
+    return codecFactoryIdentities.clone();
+  }
+
   /** Returns the immutable exact target-to-Mixin registration snapshot. */
   @Internal
   public Map<Class<?>, Class<?>> mixins() {
@@ -201,15 +223,30 @@ public final class JsonConfig {
             .thenComparing(entry -> entry.getValue().getName()));
     StringBuilder builder = new StringBuilder(entries.size() * 64);
     for (Map.Entry<Class<?>, Class<?>> entry : entries) {
-      builder
-          .append(entry.getKey().getName())
-          .append('=')
-          .append(entry.getValue().getName())
-          .append(';');
+      appendIdentity(builder, entry.getKey().getName());
+      appendIdentity(builder, entry.getValue().getName());
+    }
+    return builder.toString();
+  }
+
+  private static String identityKey(String kind, List<String> identities) {
+    if (identities.isEmpty()) {
+      return "";
+    }
+    ArrayList<String> sorted = new ArrayList<>(identities);
+    sorted.sort(String::compareTo);
+    StringBuilder builder = new StringBuilder(sorted.size() * 48);
+    for (String identity : sorted) {
+      appendIdentity(builder, kind);
+      appendIdentity(builder, identity);
     }
     return builder.toString();
   }
 
+  private static void appendIdentity(StringBuilder builder, String value) {
+    builder.append(value.length()).append(':').append(value);
+  }
+
   private static final AtomicInteger COUNTER = new AtomicInteger(0);
 
   // Equal generated source inputs share one map entry, following core generated-code naming model.
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/java/fory-json/src/main/java/org/apache/fory/json/ModuleContext.java
similarity index 54%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to java/fory-json/src/main/java/org/apache/fory/json/ModuleContext.java
index 142362da2..cbfd5cb70 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/ModuleContext.java
@@ -17,24 +17,21 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json;
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
+import org.apache.fory.json.codec.JsonValueCodec;
 
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
+/** Build-time registration surface exposed to a {@link ForyJsonModule}. */
+public interface ModuleContext {
+  /** Registers a complete codec for one exact class. */
+  <T> void registerCodec(Class<T> type, JsonValueCodec<T> codec);
 
-  public String getId() {
-    return id;
-  }
+  /** Registers a resolver-owned codec factory for one exact class. */
+  <T> void registerCodec(Class<T> type, JsonCodecFactory factory);
 
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
+  /** Registers the target Mixin declared by {@code mixinType}. */
+  void registerMixin(Class<?> mixinType);
 
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
-  }
+  /** Registers one cold-path factory for parameterized type families. */
+  void registerCodecFactory(JsonCodecFactory factory);
 }
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/ModuleInstaller.java b/java/fory-json/src/main/java/org/apache/fory/json/ModuleInstaller.java
new file mode 100644
index 000000000..829c0bcc0
--- /dev/null
+++ b/java/fory-json/src/main/java/org/apache/fory/json/ModuleInstaller.java
@@ -0,0 +1,177 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import org.apache.fory.json.annotation.JsonMixin;
+import org.apache.fory.json.codec.JsonValueCodec;
+import org.apache.fory.json.resolver.CodecRegistry;
+
+/** Owns one transactional module installation performed by {@link ForyJsonBuilder#build()}. */
+final class ModuleInstaller implements ModuleContext {
+  private final CodecRegistry codecs = new CodecRegistry();
+  private final Map<Class<?>, Class<?>> mixins = new IdentityHashMap<>();
+  private final List<JsonCodecFactory> factories = new ArrayList<>();
+  private final List<String> factoryIdentities = new ArrayList<>();
+  private final Set<String> moduleIdentities = new HashSet<>();
+  private final Set<String> fallbackIdentities = new HashSet<>();
+  private String installingModule;
+  private boolean frozen;
+
+  static InstalledModules install(
+      List<ForyJsonModule> modules,
+      CodecRegistry applicationCodecs,
+      Map<Class<?>, Class<?>> applicationMixins) {
+    ModuleInstaller installer = new ModuleInstaller();
+    try {
+      for (ForyJsonModule module : modules) {
+        String key = Objects.requireNonNull(module.moduleKey(), "moduleKey");
+        if (key.isEmpty()) {
+          throw new IllegalArgumentException("Fory JSON module key must not be empty");
+        }
+        String identity = module.getClass().getName() + ':' + key;
+        if (!installer.moduleIdentities.add(identity)) {
+          throw new IllegalArgumentException("Duplicate Fory JSON module " + identity);
+        }
+        installer.installingModule = identity;
+        module.install(installer);
+      }
+      installer.frozen = true;
+      CodecRegistry mergedCodecs = applicationCodecs.copy();
+      mergedCodecs.putDefaults(installer.codecs);
+      Map<Class<?>, Class<?>> mergedMixins = new IdentityHashMap<>(installer.mixins);
+      mergedMixins.putAll(applicationMixins);
+      ArrayList<String> identities = new ArrayList<>(installer.moduleIdentities);
+      identities.sort(String::compareTo);
+      return new InstalledModules(
+          mergedCodecs,
+          mergedMixins,
+          installer.factories.toArray(new JsonCodecFactory[0]),
+          Collections.unmodifiableList(identities),
+          Collections.unmodifiableList(new ArrayList<>(installer.factoryIdentities)));
+    } finally {
+      installer.frozen = true;
+      installer.installingModule = null;
+    }
+  }
+
+  @Override
+  public <T> void registerCodec(Class<T> type, JsonValueCodec<T> codec) {
+    checkMutable();
+    requireNewExact(type);
+    codecs.register(type, codec);
+  }
+
+  @Override
+  public <T> void registerCodec(Class<T> type, JsonCodecFactory factory) {
+    checkMutable();
+    requireNewExact(type);
+    codecs.registerFactory(type, factory);
+  }
+
+  @Override
+  public void registerMixin(Class<?> mixinType) {
+    checkMutable();
+    Class<?> target = mixinTarget(mixinType);
+    if (mixins.put(target, mixinType) != null) {
+      throw new IllegalArgumentException(
+          "Duplicate module JSON Mixin target " + target.getName() + " from " + installingModule);
+    }
+  }
+
+  @Override
+  public void registerCodecFactory(JsonCodecFactory factory) {
+    checkMutable();
+    Objects.requireNonNull(factory, "factory");
+    String key = Objects.requireNonNull(factory.factoryKey(), "factoryKey");
+    if (key.isEmpty()) {
+      throw new IllegalArgumentException("JSON codec factory key must not be empty");
+    }
+    String identity = factory.getClass().getName() + ':' + key;
+    if (!fallbackIdentities.add(identity)) {
+      throw new IllegalArgumentException("Duplicate JSON codec factory " + identity);
+    }
+    factories.add(factory);
+    factoryIdentities.add(identity);
+  }
+
+  private void requireNewExact(Class<?> type) {
+    Objects.requireNonNull(type, "type");
+    if (codecs.contains(type)) {
+      throw new IllegalArgumentException(
+          "Duplicate module JSON codec target " + type.getName() + " from " + installingModule);
+    }
+  }
+
+  private void checkMutable() {
+    if (frozen || installingModule == null) {
+      throw new IllegalStateException("Fory JSON module context is no longer mutable");
+    }
+  }
+
+  static Class<?> mixinTarget(Class<?> mixinType) {
+    Objects.requireNonNull(mixinType, "mixinType");
+    JsonMixin declaration;
+    try {
+      declaration = mixinType.getDeclaredAnnotation(JsonMixin.class);
+    } catch (RuntimeException | LinkageError e) {
+      throw new IllegalArgumentException(
+          "Cannot read JSON Mixin declaration " + mixinType.getName(), e);
+    }
+    if (declaration == null) {
+      throw new IllegalArgumentException(
+          "JSON Mixin source is missing @JsonMixin: " + mixinType.getName());
+    }
+    try {
+      return declaration.target();
+    } catch (RuntimeException | LinkageError e) {
+      throw new IllegalArgumentException(
+          "Cannot resolve JSON Mixin target for " + mixinType.getName(), e);
+    }
+  }
+
+  static final class InstalledModules {
+    final CodecRegistry codecs;
+    final Map<Class<?>, Class<?>> mixins;
+    final JsonCodecFactory[] factories;
+    final List<String> moduleIdentities;
+    final List<String> factoryIdentities;
+
+    private InstalledModules(
+        CodecRegistry codecs,
+        Map<Class<?>, Class<?>> mixins,
+        JsonCodecFactory[] factories,
+        List<String> moduleIdentities,
+        List<String> factoryIdentities) {
+      this.codecs = codecs;
+      this.mixins = mixins;
+      this.factories = factories;
+      this.moduleIdentities = moduleIdentities;
+      this.factoryIdentities = factoryIdentities;
+    }
+  }
+}
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/annotation/JsonIgnore.java b/java/fory-json/src/main/java/org/apache/fory/json/annotation/JsonIgnore.java
index abadb7627..083d5cdc9 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/annotation/JsonIgnore.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/annotation/JsonIgnore.java
@@ -26,20 +26,21 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Excludes one field-backed logical property from JSON reading, writing, or both directions.
+ * Excludes one logical property from JSON reading, writing, or both directions.
  *
  * <p>An eligible backing field, getter, and setter with the same Java property name form one
- * logical property. This field annotation removes the selected direction from that complete
- * property, so a same-named accessor cannot restore it. The annotation does not make an otherwise
- * ineligible field or accessor eligible and cannot be overridden by {@link JsonProperty}.
+ * logical property. An annotation on any field, accessor, setter value, or selected creator
+ * parameter removes the selected direction from that complete property, so another declaration
+ * cannot restore it. The annotation does not make an otherwise ineligible declaration eligible and
+ * cannot be overridden by {@link JsonProperty}.
  */
 @Documented
 @Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.FIELD)
+@Target({ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER})
 public @interface JsonIgnore {
-  /** Whether this field is ignored when reading JSON into an object. */
+  /** Whether this logical property is ignored when reading JSON into an object. */
   boolean ignoreRead() default true;
 
-  /** Whether this field is ignored when writing an object as JSON. */
+  /** Whether this logical property is ignored when writing an object as JSON. */
   boolean ignoreWrite() default true;
 }
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/ClosedSubtypeCodec.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/ClosedSubtypeCodec.java
index 0e2e3a9b7..4d16d974d 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codec/ClosedSubtypeCodec.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/ClosedSubtypeCodec.java
@@ -34,6 +34,7 @@ import org.apache.fory.json.resolver.JsonTypeInfo;
 import org.apache.fory.json.resolver.JsonTypeResolver;
 import org.apache.fory.json.writer.StringJsonWriter;
 import org.apache.fory.json.writer.Utf8JsonWriter;
+import org.apache.fory.reflect.TypeRef;
 
 /**
  * Resolver-local closed subtype dispatcher whose branch slots follow child JsonTypeInfo updates.
@@ -49,9 +50,11 @@ import org.apache.fory.json.writer.Utf8JsonWriter;
  */
 @Internal
 @SuppressWarnings("unchecked")
-public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
+public final class ClosedSubtypeCodec implements CompositeJsonCodec<Object> {
   private final Class<?> baseType;
   private final JsonSubTypesInfo definition;
+  private final TypeRef<?> declaredType;
+  private final Object[] singletonValues;
   private final JsonTypeInfo[] children;
   private final ObjectCodec<Object>[] objectCodecs;
   private JsonFieldTable[] inlineReadTables;
@@ -62,8 +65,38 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
   /** Creates an unresolved resolver-local dispatcher shell for a validated subtype definition. */
   @Internal
   public ClosedSubtypeCodec(Class<?> baseType, JsonSubTypesInfo definition) {
+    this(baseType, definition, null);
+  }
+
+  /** Creates an unresolved dispatcher with an exact factory-owned declared root type. */
+  @Internal
+  public ClosedSubtypeCodec(
+      Class<?> baseType, JsonSubTypesInfo definition, TypeRef<?> declaredType) {
+    this(baseType, definition, declaredType, null);
+  }
+
+  /** Creates an unresolved dispatcher with parent-owned singleton subtype values. */
+  @Internal
+  public ClosedSubtypeCodec(
+      Class<?> baseType,
+      JsonSubTypesInfo definition,
+      TypeRef<?> declaredType,
+      Object[] singletonValues) {
     this.baseType = baseType;
     this.definition = definition;
+    this.declaredType = declaredType;
+    if (singletonValues != null && singletonValues.length != definition.classes.length) {
+      throw new IllegalArgumentException("Singleton values do not match subtype branches");
+    }
+    this.singletonValues = singletonValues == null ? null : singletonValues.clone();
+    if (singletonValues != null) {
+      for (int i = 0; i < singletonValues.length; i++) {
+        Object value = singletonValues[i];
+        if (value != null && value.getClass() != definition.classes[i]) {
+          throw new IllegalArgumentException("Singleton value does not match subtype branch " + i);
+        }
+      }
+    }
     children = new JsonTypeInfo[definition.classes.length];
     objectCodecs =
         definition.inclusion == Inclusion.PROPERTY
@@ -71,6 +104,12 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
             : null;
   }
 
+  /** Returns the closed root that owns this codec's discriminator schema. */
+  @Internal
+  public Class<?> baseType() {
+    return baseType;
+  }
+
   /**
    * Resolves every finite subtype branch after this dispatcher's base-type shell is published.
    *
@@ -79,16 +118,24 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
    * fails.
    */
   @Internal
-  public void resolve(JsonTypeResolver resolver) {
+  @Override
+  public void resolveTypes(TypeRef<?> type, JsonTypeResolver resolver) {
+    TypeRef<?> rootType = declaredType == null ? type : declaredType;
     for (int i = 0; i < children.length; i++) {
       Class<?> subtype = definition.classes[i];
-      JsonTypeInfo child = resolver.getTypeInfo(subtype, subtype);
+      TypeRef<?> childType = rootType.getSubtype(subtype);
+      Object singleton = singletonValues == null ? null : singletonValues[i];
+      JsonTypeInfo child =
+          singleton == null
+              ? resolver.getSubtypeTypeInfo(
+                  baseType, childType.getType(), subtype, declaredType != null)
+              : resolver.createLeafTypeInfo(childType, new SingletonSubtypeCodec(singleton));
       if (definition.inclusion == Inclusion.PROPERTY) {
-        if (resolver.canonicalObjectCodec(child) == null) {
+        ObjectCodec<?> objectCodec = resolver.canonicalObjectCodec(child);
+        if (objectCodec == null) {
           throw new ForyJsonException(
               "Inline JSON subtype requires the default object representation: " + subtype);
         }
-        ObjectCodec<?> objectCodec = resolver.getObjectCodec(subtype);
         rejectDiscriminatorCollision(objectCodec, definition.scanInfo.property());
         objectCodecs[i] = (ObjectCodec<Object>) objectCodec;
         ObjectCodec.AnyInfo any = objectCodec.anyInfo();
@@ -116,7 +163,7 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
       writer.writeNull();
       return;
     }
-    int index = requireSubtype(value.getClass());
+    int index = requireSubtype(value);
     if (definition.inclusion == Inclusion.PROPERTY) {
       writer.writeObjectStart();
       writer.writeRawValue(
@@ -146,7 +193,7 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
       writer.writeNull();
       return;
     }
-    int index = requireSubtype(value.getClass());
+    int index = requireSubtype(value);
     if (definition.inclusion == Inclusion.PROPERTY) {
       writer.writeObjectStart();
       writer.writeRawValue(definition.utf8SubtypePrefixes[index]);
@@ -275,8 +322,26 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
     return value;
   }
 
-  private int requireSubtype(Class<?> runtimeType) {
-    int index = definition.classIndex(runtimeType);
+  private int requireSubtype(Object value) {
+    Class<?> runtimeType = value.getClass();
+    Object[] singletons = singletonValues;
+    if (singletons != null) {
+      int classMatch = -1;
+      for (int i = 0; i < singletons.length; i++) {
+        Object singleton = singletons[i];
+        if (singleton != null) {
+          if (value == singleton) {
+            return i;
+          }
+        } else if (definition.classes[i] == runtimeType) {
+          classMatch = i;
+        }
+      }
+      if (classMatch >= 0) {
+        return classMatch;
+      }
+    }
+    int index = singletons == null ? definition.classIndex(runtimeType) : -1;
     if (index < 0) {
       throw new ForyJsonException(
           "Runtime type " + runtimeType.getName() + " is not a declared subtype of " + baseType);
@@ -284,6 +349,61 @@ public final class ClosedSubtypeCodec implements JsonValueCodec<Object> {
     return index;
   }
 
+  private static final class SingletonSubtypeCodec implements JsonValueCodec<Object> {
+    private final Object singleton;
+
+    private SingletonSubtypeCodec(Object singleton) {
+      this.singleton = singleton;
+    }
+
+    @Override
+    public void writeString(StringJsonWriter writer, Object value) {
+      requireSingleton(value);
+      writer.writeObjectStart();
+      writer.writeObjectEnd();
+    }
+
+    @Override
+    public void writeUtf8(Utf8JsonWriter writer, Object value) {
+      requireSingleton(value);
+      writer.writeObjectStart();
+      writer.writeObjectEnd();
+    }
+
+    @Override
+    public Object readLatin1(Latin1JsonReader reader) {
+      readEmptyObject(reader);
+      return singleton;
+    }
+
+    @Override
+    public Object readUtf16(Utf16JsonReader reader) {
+      readEmptyObject(reader);
+      return singleton;
+    }
+
+    @Override
+    public Object readUtf8(Utf8JsonReader reader) {
+      readEmptyObject(reader);
+      return singleton;
+    }
+
+    private void requireSingleton(Object value) {
+      if (value != singleton) {
+        throw new ForyJsonException("Expected closed subtype singleton " + singleton);
+      }
+    }
+
+    private static void readEmptyObject(org.apache.fory.json.reader.JsonReader reader) {
+      reader.enterDepth();
+      reader.expectNextToken('{');
+      if (!reader.consumeNextToken('}')) {
+        throw new ForyJsonException("Closed subtype singleton requires an empty JSON object");
+      }
+      reader.exitDepth();
+    }
+  }
+
   @Internal
   public int childCount() {
     return children.length;
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/CompositeJsonCodec.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/CompositeJsonCodec.java
new file mode 100644
index 000000000..0cec3c49e
--- /dev/null
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/CompositeJsonCodec.java
@@ -0,0 +1,43 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.codec;
+
+import org.apache.fory.annotation.Internal;
+import org.apache.fory.json.ForyJsonException;
+import org.apache.fory.json.annotation.JsonCodec;
+import org.apache.fory.json.resolver.JsonTypeResolver;
+import org.apache.fory.reflect.TypeRef;
+
+/**
+ * A codec whose child type metadata is bound after its own metadata has been published.
+ *
+ * <p>This lifecycle belongs only to composite codecs. Keep {@link JsonValueCodec} free of resolver
+ * binding so leaf codecs do not inherit a meaningless cold-path capability.
+ */
+@Internal
+public interface CompositeJsonCodec<T> extends JsonValueCodec<T> {
+  /** Binds child type metadata during the resolver-owned cold resolution transaction. */
+  void resolveTypes(TypeRef<?> type, JsonTypeResolver resolver);
+
+  /** Binds explicitly configured direct child codecs during the same cold transaction. */
+  default void resolveTypes(TypeRef<?> type, JsonTypeResolver resolver, JsonCodec childCodecs) {
+    throw new ForyJsonException("@JsonCodec child slots are unsupported for " + type.getType());
+  }
+}
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/JsonObjectModel.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/JsonObjectModel.java
new file mode 100644
index 000000000..0dbcce2b6
--- /dev/null
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/JsonObjectModel.java
@@ -0,0 +1,115 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.codec;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.util.HashSet;
+import java.util.Objects;
+import org.apache.fory.annotation.Internal;
+
+/** Immutable constructor and accessor metadata supplied by a language JSON module. */
+@Internal
+public final class JsonObjectModel {
+  private final Constructor<?> constructor;
+  private final String[] parameterNames;
+  private final Method[] accessors;
+  private final Method[] defaultMethods;
+  private final String[] propertyNames;
+  private final Method[] propertyGetters;
+  private final Method[] propertySetters;
+
+  public JsonObjectModel(
+      Constructor<?> constructor,
+      String[] parameterNames,
+      Method[] accessors,
+      Method[] defaultMethods) {
+    this(constructor, parameterNames, accessors, defaultMethods, parameterNames, accessors, null);
+  }
+
+  public JsonObjectModel(
+      Constructor<?> constructor,
+      String[] parameterNames,
+      Method[] accessors,
+      Method[] defaultMethods,
+      String[] propertyNames,
+      Method[] propertyGetters,
+      Method[] propertySetters) {
+    this.constructor = Objects.requireNonNull(constructor, "constructor");
+    this.parameterNames = parameterNames.clone();
+    this.accessors = accessors.clone();
+    this.defaultMethods = defaultMethods.clone();
+    this.propertyNames = propertyNames.clone();
+    this.propertyGetters = propertyGetters.clone();
+    this.propertySetters =
+        propertySetters == null ? new Method[propertyNames.length] : propertySetters.clone();
+    int count = constructor.getParameterCount();
+    if (this.parameterNames.length != count
+        || this.accessors.length != count
+        || this.defaultMethods.length != count) {
+      throw new IllegalArgumentException("JSON object model arrays must match constructor arity");
+    }
+    HashSet<String> names = new HashSet<>();
+    for (String name : this.parameterNames) {
+      if (name == null || name.isEmpty() || !names.add(name)) {
+        throw new IllegalArgumentException("Invalid JSON object model parameter name " + name);
+      }
+    }
+    if (this.propertyGetters.length != this.propertyNames.length
+        || this.propertySetters.length != this.propertyNames.length) {
+      throw new IllegalArgumentException(
+          "JSON object model property arrays must have equal length");
+    }
+    names.clear();
+    for (String name : this.propertyNames) {
+      if (name == null || name.isEmpty() || !names.add(name)) {
+        throw new IllegalArgumentException("Invalid JSON object model property name " + name);
+      }
+    }
+  }
+
+  public Constructor<?> constructor() {
+    return constructor;
+  }
+
+  public String[] parameterNames() {
+    return parameterNames.clone();
+  }
+
+  public Method[] accessors() {
+    return accessors.clone();
+  }
+
+  public Method[] defaultMethods() {
+    return defaultMethods.clone();
+  }
+
+  public String[] propertyNames() {
+    return propertyNames.clone();
+  }
+
+  public Method[] propertyGetters() {
+    return propertyGetters.clone();
+  }
+
+  public Method[] propertySetters() {
+    return propertySetters.clone();
+  }
+}
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/MapCodec.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/MapCodec.java
index 0faaf7cf5..2adc5012c 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codec/MapCodec.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/MapCodec.java
@@ -323,6 +323,12 @@ public abstract class MapCodec<T extends Map<?, ?>> implements JsonValueCodec<T>
     throw new ForyJsonException("Unsupported JSON map key type " + rawType);
   }
 
+  /** Returns the built-in object-member codec for one already approved map key type. */
+  @Internal
+  public static MapKeyCodec keyCodec(Class<?> rawType) {
+    return defaultKeyCodec(rawType);
+  }
+
   @SuppressWarnings("unchecked")
   private static MapFactory mapFactory(Class<?> rawType, Class<?> keyRawType) {
     if (unsupportedMapType(rawType) || GuavaCodecs.isUnsupportedImmutableImpl(rawType)) {
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodec.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodec.java
index 025abfaa6..3c1d81bba 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodec.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodec.java
@@ -77,7 +77,7 @@ import org.apache.fory.serializer.GraphMemoryEstimates;
  * paths independently, but it is built from this codec's immutable field metadata and preserves the
  * same null, unknown-field, creator, and member-discovery semantics.
  */
-public class ObjectCodec<T> implements JsonValueCodec<T> {
+public class ObjectCodec<T> implements CompositeJsonCodec<T> {
   protected final Class<?> type;
   protected final JsonFieldInfo[] writeFields;
   protected final JsonFieldInfo[] readFields;
@@ -133,6 +133,30 @@ public class ObjectCodec<T> implements JsonValueCodec<T> {
     }
   }
 
+  /** Builds an object codec from a validated language-module object model. */
+  @Internal
+  public static <T> ObjectCodec<T> build(
+      TypeRef<T> ownerType,
+      boolean propertyDiscoveryEnabled,
+      PropertyNamingStrategy propertyNamingStrategy,
+      boolean writeNullFields,
+      JsonSharedRegistry sharedRegistry,
+      GeneratedJsonCodec<?> generatedCodec,
+      JsonObjectModel objectModel) {
+    try {
+      return ObjectCodecBuilder.build(
+          ownerType,
+          propertyDiscoveryEnabled,
+          propertyNamingStrategy,
+          writeNullFields,
+          sharedRegistry,
+          generatedCodec,
+          objectModel);
+    } catch (ForyJsonException e) {
+      throw sharedRegistry.mixinSchemaFailure(ownerType.getRawType(), e);
+    }
+  }
+
   static <T> ObjectCodec<T> createCodec(
       TypeRef<T> ownerType,
       JsonFieldInfo[] writeFields,
@@ -276,6 +300,11 @@ public class ObjectCodec<T> implements JsonValueCodec<T> {
     }
   }
 
+  @Override
+  public final void resolveTypes(TypeRef<?> type, JsonTypeResolver resolver) {
+    resolveTypes(resolver);
+  }
+
   @Internal
   public final void resolveDirectTypes(JsonTypeResolver typeResolver) {
     if (directTypesResolved) {
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodecBuilder.java b/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodecBuilder.java
index 285dfa973..c615934a6 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodecBuilder.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codec/ObjectCodecBuilder.java
@@ -83,19 +83,39 @@ final class ObjectCodecBuilder {
       boolean writeNullFields,
       JsonSharedRegistry sharedRegistry,
       GeneratedJsonCodec<?> generatedCodec) {
+    return build(
+        ownerType,
+        propertyDiscoveryEnabled,
+        propertyNamingStrategy,
+        writeNullFields,
+        sharedRegistry,
+        generatedCodec,
+        null);
+  }
+
+  static <T> ObjectCodec<T> build(
+      TypeRef<T> ownerType,
+      boolean propertyDiscoveryEnabled,
+      PropertyNamingStrategy propertyNamingStrategy,
+      boolean writeNullFields,
+      JsonSharedRegistry sharedRegistry,
+      GeneratedJsonCodec<?> generatedCodec,
+      JsonObjectModel objectModel) {
     Class<?> type = ownerType.getRawType();
     Annotations annotations = new Annotations(type, sharedRegistry);
     boolean record =
         generatedCodec == null ? RecordUtils.isRecord(type) : generatedCodec.validatedRecord();
     boolean hasAnyField =
         validateMemberAnnotations(
-            type, propertyDiscoveryEnabled, record, generatedCodec, annotations);
+            type, propertyDiscoveryEnabled, record, generatedCodec, annotations, objectModel);
     JsonValidatorInfo validatorInfo =
         JsonValidatorInfo.create(type, findValidators(type, annotations), generatedCodec);
     LinkedHashMap<String, FieldBuilder> builders = new LinkedHashMap<>();
     addFields(type, record, propertyDiscoveryEnabled, hasAnyField, builders, annotations);
     if (record) {
       addRecordAccessors(type, builders, generatedCodec);
+    } else if (objectModel != null) {
+      addObjectModelAccessors(type, builders, annotations, objectModel);
     }
     Method anySetter =
         addJsonMethods(
@@ -142,18 +162,12 @@ final class ObjectCodecBuilder {
                 propertyNamingStrategy,
                 creatorOnlyUnwrapped,
                 generatedCodec,
-                annotations);
+                annotations,
+                objectModel);
     if (anySetter != null && (record || creatorInfo != null)) {
       throw new ForyJsonException(
           "@JsonAnySetter is not supported on constructor-backed type " + type.getName());
     }
-    if (creatorInfo != null
-        && anyBuilder != null
-        && anyBuilder.anyReadEnabled()
-        && anyBuilder.creatorArgumentIndex < 0) {
-      throw new ForyJsonException(
-          "Read-enabled @JsonAnyProperty must bind one @JsonCreator argument on " + type.getName());
-    }
     JsonPropertyOrder propertyOrder = findPropertyOrder(type, annotations);
     boolean hasAny = anyBuilder != null || anySetter != null;
     boolean hasUnwrapped = !creatorOnlyUnwrapped.isEmpty() || hasUnwrappedProperty(builders);
@@ -166,10 +180,13 @@ final class ObjectCodecBuilder {
     List<Declaration> unwrappedDeclarations =
         hasUnwrapped ? new ArrayList<>(builders.size() + creatorOnlyUnwrapped.size()) : null;
     List<JsonFieldInfo> reads = new ArrayList<>();
+    List<JsonFieldInfo> deferredFields = objectModel == null ? null : new ArrayList<>();
+    List<JsonFieldInfo> directDeferredFields = objectModel == null ? null : new ArrayList<>();
     List<String> skippedNames = hasAny ? new ArrayList<>() : null;
     Map<String, FieldBuilder> canonicalNames = new LinkedHashMap<>();
     Map<Long, String> canonicalHashes = new LinkedHashMap<>();
     int anyOriginalIndex = -1;
+    int anyConstructionIndex = -1;
     for (FieldBuilder builder : builders.values()) {
       if (builder == anyBuilder) {
         if (anyWrites) {
@@ -178,6 +195,13 @@ final class ObjectCodecBuilder {
             unwrappedWrites.add(UnwrappedWriteBuilder.any(builder));
           }
         }
+        if (objectModel != null && builder.anyReadEnabled() && builder.creatorArgumentIndex < 0) {
+          JsonFieldInfo field =
+              builder.build(
+                  record, ownerType, propertyNamingStrategy, writeNullFields, generatedCodec);
+          anyConstructionIndex = creatorInfo.argumentCount() + deferredFields.size();
+          deferredFields.add(field);
+        }
         continue;
       }
       if (hasAny && builder.hasLogicalMember() && builder.unwrappedAnnotation == null) {
@@ -204,7 +228,9 @@ final class ObjectCodecBuilder {
               "JSON property name hash collision between " + priorHashName + " and " + name);
         }
         boolean creatorInput = creatorInfo != null && builder.creatorArgumentIndex >= 0;
-        boolean readableFixed = creatorInfo == null && builder.hasReadSink();
+        boolean readableFixed =
+            builder.hasReadSink()
+                && (creatorInfo == null || objectModel != null && builder.creatorArgumentIndex < 0);
         if (!creatorInput && !readableFixed) {
           skippedNames.add(name);
         }
@@ -218,7 +244,14 @@ final class ObjectCodecBuilder {
                 + " from "
                 + builder.explicitIndexSource);
       }
-      if (!builder.hasWriteSource() && !builder.hasReadSink()) {
+      boolean creatorDirection =
+          creatorInfo != null && builder.creatorArgumentIndex >= 0 && builder.creatorReadAllowed();
+      if (!builder.hasWriteSource() && !builder.hasReadSink() && !creatorDirection) {
+        if (objectModel != null
+            && builder.creatorArgumentIndex >= 0
+            && creatorInfo.hasDefault(builder.creatorArgumentIndex)) {
+          continue;
+        }
         if (builder.hasConfiguration()) {
           throw new ForyJsonException(
               "JSON property annotation has no readable or writable direction for " + builder.name);
@@ -230,9 +263,13 @@ final class ObjectCodecBuilder {
         JsonFieldInfo property =
             builder.build(
                 record, ownerType, propertyNamingStrategy, writeNullFields, generatedCodec);
+        markRequiredWrite(property, builder, creatorInfo, objectModel);
         int unwrappedConstructionIndex = -1;
         if (creatorInfo != null && builder.creatorArgumentIndex >= 0) {
           unwrappedConstructionIndex = builder.creatorArgumentIndex;
+        } else if (objectModel != null && builder.hasReadSink()) {
+          unwrappedConstructionIndex = creatorInfo.argumentCount() + deferredFields.size();
+          deferredFields.add(property);
         }
         Declaration declaration =
             builder.buildUnwrappedDeclaration(
@@ -243,7 +280,7 @@ final class ObjectCodecBuilder {
         }
         continue;
       }
-      if (creatorInfo != null && !builder.hasWriteSource()) {
+      if (creatorInfo != null && objectModel == null && !builder.hasWriteSource()) {
         if (builder.explicitInclude != JsonProperty.Include.DEFAULT) {
           throw new ForyJsonException(
               "JSON inclusion policy requires a write source for property " + builder.name);
@@ -256,6 +293,7 @@ final class ObjectCodecBuilder {
       }
       JsonFieldInfo field =
           builder.build(record, ownerType, propertyNamingStrategy, writeNullFields, generatedCodec);
+      markRequiredWrite(field, builder, creatorInfo, objectModel);
       if (!hasAny) {
         FieldBuilder priorProperty = canonicalNames.put(field.name(), builder);
         if (priorProperty != null) {
@@ -279,7 +317,8 @@ final class ObjectCodecBuilder {
           writeBuilders.add(builder);
         }
       }
-      if (creatorInfo == null && builder.hasReadSink()) {
+      if (builder.hasReadSink()
+          && (creatorInfo == null || objectModel != null && builder.creatorArgumentIndex < 0)) {
         if (!hasAny) {
           String priorHashName = canonicalHashes.put(field.nameHash(), field.name());
           if (priorHashName != null && !priorHashName.equals(field.name())) {
@@ -291,6 +330,10 @@ final class ObjectCodecBuilder {
           }
         }
         reads.add(field);
+        if (objectModel != null) {
+          deferredFields.add(field);
+          directDeferredFields.add(field);
+        }
       }
     }
     if (hasUnwrapped) {
@@ -324,13 +367,22 @@ final class ObjectCodecBuilder {
               : orderWriteFields(type, propertyOrder, writeBuilders, writes);
     }
     JsonFieldInfo[] readArray = reads.toArray(new JsonFieldInfo[0]);
+    if (objectModel != null && !deferredFields.isEmpty()) {
+      creatorInfo =
+          creatorInfo.withDeferredFields(
+              deferredFields.toArray(new JsonFieldInfo[0]),
+              directDeferredFields.toArray(new JsonFieldInfo[0]));
+    }
     for (int i = 0; i < readArray.length; i++) {
       readArray[i].setReadIndex(i);
     }
     int constructionIndex = -1;
     if (anyBuilder != null && anyBuilder.anyReadEnabled()) {
       if (creatorInfo != null) {
-        constructionIndex = anyBuilder.creatorArgumentIndex;
+        constructionIndex =
+            anyBuilder.creatorArgumentIndex >= 0
+                ? anyBuilder.creatorArgumentIndex
+                : objectModel == null ? -1 : anyConstructionIndex;
       }
     }
     AnyInfo anyInfo =
@@ -368,6 +420,23 @@ final class ObjectCodecBuilder {
         validatorInfo);
   }
 
+  private static void markRequiredWrite(
+      JsonFieldInfo field,
+      FieldBuilder builder,
+      JsonCreatorInfo creatorInfo,
+      JsonObjectModel objectModel) {
+    int argumentIndex = builder.creatorArgumentIndex;
+    if (objectModel != null
+        && creatorInfo != null
+        && argumentIndex >= 0
+        && !creatorInfo.hasDefault(argumentIndex)
+        && builder.hasWriteSource()
+        && !field.writeNull()
+        && !field.writeRawType().isPrimitive()) {
+      field.requireNonNullWrite();
+    }
+  }
+
   private static Method[] findValidators(Class<?> type, Annotations annotations) {
     List<Method> validators = null;
     for (Method method : type.getMethods()) {
@@ -1007,6 +1076,35 @@ final class ObjectCodecBuilder {
     }
   }
 
+  private static void addObjectModelAccessors(
+      Class<?> type,
+      LinkedHashMap<String, FieldBuilder> builders,
+      Annotations annotations,
+      JsonObjectModel objectModel) {
+    String[] names = objectModel.propertyNames();
+    Method[] accessors = objectModel.propertyGetters();
+    Method[] setters = objectModel.propertySetters();
+    String[] parameterNames = objectModel.parameterNames();
+    Type[] parameterTypes = objectModel.constructor().getGenericParameterTypes();
+    for (int i = 0; i < names.length; i++) {
+      Method accessor = accessors[i];
+      FieldBuilder builder =
+          builders.computeIfAbsent(names[i], name -> new FieldBuilder(name, annotations));
+      for (int parameterIndex = 0; parameterIndex < parameterNames.length; parameterIndex++) {
+        if (names[i].equals(parameterNames[parameterIndex])) {
+          builder.setObjectModelType(parameterTypes[parameterIndex]);
+          break;
+        }
+      }
+      if (accessor != null) {
+        builder.setWriteGetter(type, accessor);
+      }
+      if (setters[i] != null) {
+        builder.setReadSetter(type, setters[i]);
+      }
+    }
+  }
+
   private static void rejectRecordCreator(Class<?> type, Annotations annotations) {
     for (Constructor<?> constructor : type.getDeclaredConstructors()) {
       if (annotations.has(constructor, JsonCreator.class)) {
@@ -1101,14 +1199,18 @@ final class ObjectCodecBuilder {
       PropertyNamingStrategy namingStrategy,
       List<Declaration> creatorOnlyUnwrapped,
       GeneratedJsonCodec<?> generatedCodec,
-      Annotations annotations) {
+      Annotations annotations,
+      JsonObjectModel objectModel) {
     JsonCreatorDeclaration declaration = JsonCreatorDeclaration.find(type, annotations.registry);
     if (declaration == null) {
       if (generatedCodec != null && generatedCodec.validatedCreatorParameterNames() != null) {
         throw new ForyJsonException(
             "Generated JSON creator does not match runtime annotations on " + type.getName());
       }
-      return null;
+      return objectModel == null
+          ? null
+          : buildObjectModelCreatorInfo(
+              type, ownerType, builders, namingStrategy, generatedCodec, annotations, objectModel);
     }
     Executable creator = declaration.executable();
     JsonCreator annotation = declaration.annotation();
@@ -1280,6 +1382,60 @@ final class ObjectCodecBuilder {
         type, creator, fieldArray, creatorDefaults(rawTypes), generatedCodec);
   }
 
+  private static JsonCreatorInfo buildObjectModelCreatorInfo(
+      Class<?> type,
+      TypeRef<?> ownerType,
+      LinkedHashMap<String, FieldBuilder> builders,
+      PropertyNamingStrategy namingStrategy,
+      GeneratedJsonCodec<?> generatedCodec,
+      Annotations annotations,
+      JsonObjectModel objectModel) {
+    Constructor<?> constructor = objectModel.constructor();
+    String[] names = objectModel.parameterNames();
+    Method[] defaultMethods = objectModel.defaultMethods();
+    Type[] parameterTypes = constructor.getGenericParameterTypes();
+    Class<?>[] rawTypes = constructor.getParameterTypes();
+    Parameter[] parameters = constructor.getParameters();
+    List<JsonCreatorFieldInfo> fields = new ArrayList<>(parameterTypes.length);
+    for (int i = 0; i < parameterTypes.length; i++) {
+      FieldBuilder builder = builders.get(names[i]);
+      if (builder == null || !builder.hasLogicalMember()) {
+        throw new ForyJsonException("Unknown JSON object-model property " + names[i]);
+      }
+      bindCreatorType(ownerType, constructor, i, parameterTypes[i], builder);
+      builder.mergeCreatorParameter(type, parameters[i]);
+      if (!builder.creatorReadAllowed()) {
+        if (defaultMethods[i] == null) {
+          throw new ForyJsonException(
+              "Ignored constructor property " + names[i] + " requires a Scala default");
+        }
+        continue;
+      }
+      if (!builder.isAny() && builder.unwrappedAnnotation == null) {
+        Type resolved = ownerType.resolveType(parameterTypes[i]).getType();
+        fields.add(
+            new JsonCreatorFieldInfo(
+                builder.jsonName(namingStrategy),
+                i,
+                resolved,
+                rawTypes[i],
+                builder.codecAnnotation(),
+                builder.valueCodecClass(),
+                builder.formatAnnotation()));
+      }
+    }
+    JsonCreatorFieldInfo[] fieldArray = fields.toArray(new JsonCreatorFieldInfo[0]);
+    rejectCreatorHashCollisions(fieldArray);
+    return new JsonCreatorInfo(
+        type,
+        constructor,
+        fieldArray,
+        creatorDefaults(rawTypes),
+        generatedCodec,
+        defaultMethods,
+        names);
+  }
+
   private static void validateGeneratedCreator(
       Class<?> type,
       Executable creator,
@@ -1395,7 +1551,8 @@ final class ObjectCodecBuilder {
       boolean propertyDiscoveryEnabled,
       boolean record,
       GeneratedJsonCodec<?> generatedCodec,
-      Annotations annotations) {
+      Annotations annotations,
+      JsonObjectModel objectModel) {
     boolean hasAnyField = false;
     for (Class<?> current = type; current != null; current = current.getSuperclass()) {
       for (Field field : current.getDeclaredFields()) {
@@ -1466,6 +1623,12 @@ final class ObjectCodecBuilder {
         if (annotations.has(method, JsonProperty.class)) {
           validatePropertyMethod(type, method, propertyDiscoveryEnabled, record, generatedCodec);
         }
+        if (annotations.has(method, JsonIgnore.class)) {
+          validateIgnoreMethod(
+              type, method, propertyDiscoveryEnabled, record, generatedCodec, objectModel);
+        }
+        validateIgnoreParameters(
+            type, method, propertyDiscoveryEnabled, record, objectModel, annotations);
         if (annotations.has(method, JsonAnyGetter.class)) {
           if (!propertyDiscoveryEnabled) {
             throw new ForyJsonException(
@@ -1489,8 +1652,9 @@ final class ObjectCodecBuilder {
     // and accessors. Do not re-read desugared constructor parameters: Android 8 ART may crash.
     if (!record || generatedCodec == null) {
       for (Constructor<?> constructor : type.getDeclaredConstructors()) {
-        validateCodecParameters(type, constructor, record, annotations);
-        validateUnwrappedParameters(type, constructor, record, annotations);
+        validateCodecParameters(type, constructor, record, objectModel, annotations);
+        validateUnwrappedParameters(type, constructor, record, objectModel, annotations);
+        validateIgnoreParameters(type, constructor, record, objectModel, annotations);
       }
     }
     for (Method method : type.getMethods()) {
@@ -1517,6 +1681,12 @@ final class ObjectCodecBuilder {
             type, method, propertyDiscoveryEnabled, record, generatedCodec, annotations);
       }
       validateUnwrappedParameters(type, method, propertyDiscoveryEnabled, record, annotations);
+      if (annotations.has(method, JsonIgnore.class)) {
+        validateIgnoreMethod(
+            type, method, propertyDiscoveryEnabled, record, generatedCodec, objectModel);
+      }
+      validateIgnoreParameters(
+          type, method, propertyDiscoveryEnabled, record, objectModel, annotations);
       if (annotations.has(method, JsonValidator.class)) {
         validateValidator(method);
       }
@@ -1524,6 +1694,96 @@ final class ObjectCodecBuilder {
     return hasAnyField;
   }
 
+  private static void validateIgnoreMethod(
+      Class<?> type,
+      Method method,
+      boolean propertyDiscoveryEnabled,
+      boolean record,
+      GeneratedJsonCodec<?> generatedCodec,
+      JsonObjectModel objectModel) {
+    if (record && isRecordAccessor(type, method, generatedCodec)) {
+      return;
+    }
+    if (containsObjectModelMethod(objectModel, method)) {
+      return;
+    }
+    if (propertyDiscoveryEnabled
+        && isEligibleAccessor(method)
+        && (getterPropertyName(method) != null || setterPropertyName(method) != null)) {
+      return;
+    }
+    throw new ForyJsonException(
+        "@JsonIgnore requires an effective JSON getter or setter: " + method);
+  }
+
+  private static void validateIgnoreParameters(
+      Class<?> type,
+      Method method,
+      boolean propertyDiscoveryEnabled,
+      boolean record,
+      JsonObjectModel objectModel,
+      Annotations annotations) {
+    Parameter[] parameters = method.getParameters();
+    for (int i = 0; i < parameters.length; i++) {
+      if (!annotations.has(parameters[i], JsonIgnore.class)) {
+        continue;
+      }
+      if (annotations.has(method, JsonCreator.class)) {
+        continue;
+      }
+      if (i == 0
+          && (containsObjectModelSetter(objectModel, method)
+              || !record
+                  && propertyDiscoveryEnabled
+                  && isEligibleAccessor(method)
+                  && setterPropertyName(method) != null)) {
+        continue;
+      }
+      throw new ForyJsonException(
+          "@JsonIgnore parameter requires a JSON setter or creator value: " + method);
+    }
+  }
+
+  private static void validateIgnoreParameters(
+      Class<?> type,
+      Constructor<?> constructor,
+      boolean record,
+      JsonObjectModel objectModel,
+      Annotations annotations) {
+    Parameter[] parameters = constructor.getParameters();
+    boolean selected =
+        annotations.has(constructor, JsonCreator.class)
+            || record && isRecordConstructor(type, constructor)
+            || objectModel != null && constructor.equals(objectModel.constructor());
+    for (Parameter parameter : parameters) {
+      if (annotations.has(parameter, JsonIgnore.class) && !selected) {
+        throw new ForyJsonException(
+            "@JsonIgnore parameter requires a selected JSON constructor: " + constructor);
+      }
+    }
+  }
+
+  private static boolean containsObjectModelMethod(JsonObjectModel model, Method method) {
+    if (model == null) {
+      return false;
+    }
+    return containsMethod(model.propertyGetters(), method)
+        || containsMethod(model.propertySetters(), method);
+  }
+
+  private static boolean containsObjectModelSetter(JsonObjectModel model, Method method) {
+    return model != null && containsMethod(model.propertySetters(), method);
+  }
+
+  private static boolean containsMethod(Method[] methods, Method target) {
+    for (Method method : methods) {
+      if (target.equals(method)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   private static void validateValidator(Method method) {
     if (!JsonValidatorInfo.isValidatorMethod(method)) {
       throw new ForyJsonException("Invalid @JsonValidator method " + method);
@@ -1582,11 +1842,17 @@ final class ObjectCodecBuilder {
   }
 
   private static void validateUnwrappedParameters(
-      Class<?> type, Constructor<?> constructor, boolean record, Annotations annotations) {
+      Class<?> type,
+      Constructor<?> constructor,
+      boolean record,
+      JsonObjectModel objectModel,
+      Annotations annotations) {
     Parameter[] parameters = constructor.getParameters();
     for (int i = 0; i < parameters.length; i++) {
       JsonUnwrapped annotation = annotations.get(parameters[i], JsonUnwrapped.class);
-      if (annotation == null || annotations.has(constructor, JsonCreator.class)) {
+      if (annotation == null
+          || annotations.has(constructor, JsonCreator.class)
+          || objectModel != null && constructor.equals(objectModel.constructor())) {
         continue;
       }
       if (record && isPropagatedRecordUnwrapped(type, constructor, i, annotation, annotations)) {
@@ -1657,7 +1923,11 @@ final class ObjectCodecBuilder {
   }
 
   private static void validateCodecParameters(
-      Class<?> type, Constructor<?> constructor, boolean record, Annotations annotations) {
+      Class<?> type,
+      Constructor<?> constructor,
+      boolean record,
+      JsonObjectModel objectModel,
+      Annotations annotations) {
     Parameter[] parameters = constructor.getParameters();
     for (int i = 0; i < parameters.length; i++) {
       JsonCodec annotation = annotations.get(parameters[i], JsonCodec.class);
@@ -1667,6 +1937,9 @@ final class ObjectCodecBuilder {
       if (record && isRecordConstructor(type, constructor)) {
         continue;
       }
+      if (objectModel != null && constructor.equals(objectModel.constructor())) {
+        continue;
+      }
       throw new ForyJsonException("@JsonCodec parameter requires a @JsonCreator: " + constructor);
     }
   }
@@ -2258,6 +2531,9 @@ final class ObjectCodecBuilder {
     private AnnotatedElement codecSource;
     private JsonUnwrapped unwrappedAnnotation;
     private AnnotatedElement unwrappedSource;
+    private boolean ignoreRead;
+    private boolean ignoreWrite;
+    private Type objectModelType;
 
     private FieldBuilder(String name, Annotations annotations) {
       this.name = name;
@@ -2275,12 +2551,13 @@ final class ObjectCodecBuilder {
         throw new ForyJsonException("Duplicate JSON field " + name);
       }
       this.field = field;
-      fieldWriteAllowed = writeAllowed;
-      fieldReadAllowed = readAllowed;
-      if (writeSource) {
+      mergeIgnore(field);
+      fieldWriteAllowed = writeAllowed && !ignoreWrite;
+      fieldReadAllowed = readAllowed && !ignoreRead;
+      if (writeSource && !ignoreWrite) {
         writeField = field;
       }
-      if (readSink) {
+      if (readSink && !ignoreRead) {
         readField = field;
       }
       mergeFormat(field);
@@ -2294,8 +2571,9 @@ final class ObjectCodecBuilder {
     }
 
     private void setWriteGetter(Class<?> type, Method getter) {
+      mergeIgnore(getter);
       mergeAnnotation(type, getter);
-      if (field != null && !fieldWriteAllowed) {
+      if (ignoreWrite || field != null && !fieldWriteAllowed) {
         return;
       }
       if (writeGetter != null) {
@@ -2305,12 +2583,21 @@ final class ObjectCodecBuilder {
       writeField = null;
     }
 
+    private void setObjectModelType(Type type) {
+      if (objectModelType != null && !objectModelType.equals(type)) {
+        throw new ForyJsonException("Conflicting JSON object-model types for property " + name);
+      }
+      objectModelType = type;
+    }
+
     private void setReadSetter(Class<?> type, Method setter) {
+      mergeIgnore(setter);
       mergeAnnotation(type, setter);
       Parameter parameter = setter.getParameters()[0];
+      mergeIgnore(parameter);
       mergeCodec(parameter);
       mergeUnwrapped(parameter);
-      if (field != null && !fieldReadAllowed) {
+      if (ignoreRead || field != null && !fieldReadAllowed) {
         return;
       }
       if (readSetter != null) {
@@ -2377,7 +2664,7 @@ final class ObjectCodecBuilder {
     }
 
     private boolean creatorReadAllowed() {
-      return field == null || fieldReadAllowed;
+      return !ignoreRead && (field == null || fieldReadAllowed);
     }
 
     private String jsonName(PropertyNamingStrategy strategy) {
@@ -2392,7 +2679,9 @@ final class ObjectCodecBuilder {
 
     private Type logicalType(TypeRef<?> ownerType) {
       Type type;
-      if (writeGetter != null) {
+      if (objectModelType != null) {
+        type = objectModelType;
+      } else if (writeGetter != null) {
         type = writeGetter.getGenericReturnType();
       } else if (writeField != null) {
         type = writeField.getGenericType();
@@ -2508,13 +2797,6 @@ final class ObjectCodecBuilder {
                 + "."
                 + name);
       }
-      if (creatorInfo != null && hasReadSink() && creatorArgumentIndex < 0) {
-        throw new ForyJsonException(
-            "Read-enabled @JsonUnwrapped property must bind one @JsonCreator argument on "
-                + type.getName()
-                + "."
-                + name);
-      }
     }
 
     private Declaration buildUnwrappedDeclaration(
@@ -2633,6 +2915,7 @@ final class ObjectCodecBuilder {
     }
 
     private void mergeCreatorParameter(Class<?> type, Parameter parameter) {
+      mergeIgnore(parameter);
       mergeCodec(parameter);
       mergeUnwrapped(parameter);
       JsonProperty property = annotations.get(parameter, JsonProperty.class);
@@ -2640,6 +2923,9 @@ final class ObjectCodecBuilder {
         mergeAnnotation(type, parameter);
         return;
       }
+      if (property == null) {
+        return;
+      }
       hasJsonProperty = true;
       int declaredIndex = property.index();
       validatePropertyIndex(declaredIndex, name, type, parameter);
@@ -2670,6 +2956,23 @@ final class ObjectCodecBuilder {
       }
     }
 
+    private void mergeIgnore(AnnotatedElement source) {
+      JsonIgnore ignore = annotations.get(source, JsonIgnore.class);
+      if (ignore == null) {
+        return;
+      }
+      if (ignore.ignoreWrite() && !ignoreWrite) {
+        ignoreWrite = true;
+        writeField = null;
+        writeGetter = null;
+      }
+      if (ignore.ignoreRead() && !ignoreRead) {
+        ignoreRead = true;
+        readField = null;
+        readSetter = null;
+      }
+    }
+
     private void mergeUnwrapped(AnnotatedElement source) {
       JsonUnwrapped declared = annotations.get(source, JsonUnwrapped.class);
       if (declared == null) {
@@ -2788,6 +3091,18 @@ final class ObjectCodecBuilder {
       if (readType != null) {
         readType = ownerType.resolveType(readType).getType();
       }
+      if (objectModelType != null) {
+        Type modelType = ownerType.resolveType(objectModelType).getType();
+        if (writeType == void.class) {
+          writeType = modelType;
+        }
+        if (writeType != null && !writeType.equals(modelType)
+            || readType != null && !readType.equals(modelType)) {
+          throw new ForyJsonException(
+              "JSON object-model type " + modelType + " does not match property " + name);
+        }
+        return;
+      }
       if (writeType != null && readType != null && !writeType.equals(readType)) {
         throw new ForyJsonException(
             "Conflicting JSON property types for " + name + ": " + writeType + " and " + readType);
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonReaderCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonReaderCodegen.java
index a5e6d4ebb..8bc29437c 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonReaderCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonReaderCodegen.java
@@ -26,6 +26,7 @@ import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
+import java.util.Arrays;
 import java.util.Map;
 import org.apache.fory.codegen.Code;
 import org.apache.fory.codegen.CodegenContext;
@@ -131,7 +132,7 @@ abstract class JsonReaderCodegen {
 
   abstract boolean isDirectName(String name, boolean tokenValueRead);
 
-  abstract Expression tryReadNextFieldNameColon(JsonFieldInfo property, boolean tokenValueRead);
+  abstract Expression tryReadNextFieldNameColon(String name);
 
   abstract Expression readEnumField(
       JsonGeneratedCodecBuilder builder,
@@ -492,7 +493,7 @@ abstract class JsonReaderCodegen {
     if (rootArray) {
       body.add(reserveObject(owner));
     }
-    Expression finishedRoot = finishUnwrappedRoot(root, type, rootCreator);
+    Expression finishedRoot = finishUnwrappedRoot(builder, root, type, rootCreator);
     body.add(new Expression.Invoke(readerRef(), "exitDepth"));
     if (owner.hasValidators()) {
       Expression finished =
@@ -607,9 +608,9 @@ abstract class JsonReaderCodegen {
         "properties",
         JsonCodegen.generatedCodecArrayType(ctx, readerArrayType()),
         "codecs");
-    addCreatorMethod(ctx, type, creatorInfo.executable());
+    addCreatorMethod(ctx, type, creatorInfo);
     ctx.clearExprState();
-    Code.ExprCode body = creatorReadExpression(type, creatorInfo).genCode(ctx);
+    Code.ExprCode body = creatorReadExpression(builder, type, creatorInfo).genCode(ctx);
     String bodyCode = body.code();
     bodyCode = bodyCode == null ? "" : ctx.optimizeMethodCode(bodyCode);
     ctx.addMethod(
@@ -650,12 +651,12 @@ abstract class JsonReaderCodegen {
       }
     }
     addAnyReaderConstructor(ctx, creatorConstructorExpression(fields), storesAnyReader);
-    addCreatorMethod(ctx, type, creatorInfo.executable());
+    addCreatorMethod(ctx, type, creatorInfo);
     addGeneratedMethod(
         ctx,
         "private final",
         anyReadMethod,
-        anyCreatorReadExpression(type, creatorInfo),
+        anyCreatorReadExpression(builder, type, creatorInfo),
         Object.class,
         concreteReaderType,
         "reader");
@@ -672,12 +673,13 @@ abstract class JsonReaderCodegen {
     return ctx.genCode();
   }
 
-  private Expression anyCreatorReadExpression(Class<?> type, JsonCreatorInfo creatorInfo) {
+  private Expression anyCreatorReadExpression(
+      JsonGeneratedCodecBuilder builder, Class<?> type, JsonCreatorInfo creatorInfo) {
     JsonCreatorFieldInfo[] fields = creatorInfo.fields();
     Class<?>[] parameterTypes = creatorInfo.executable().getParameterTypes();
     Expression.ListExpression expressions = new Expression.ListExpression();
     expressions.add(new Expression.Invoke(readerRef(), "enterDepth"));
-    Expression[] arguments = creatorArguments(creatorInfo.executable(), expressions);
+    CreatorArguments arguments = creatorArguments(creatorInfo, expressions);
     Expression anyMap =
         new Expression.Variable("anyMap", new Expression.Null(TypeRef.of(Map.class), false));
     expressions.add(anyMap);
@@ -688,7 +690,7 @@ abstract class JsonReaderCodegen {
             new Expression.ListExpression(
                 reserveObject(objectOwner),
                 new Expression.Invoke(readerRef(), "exitDepth"),
-                new Expression.Return(createValue(type, arguments)))));
+                finishCreator(builder, type, creatorInfo, arguments))));
 
     Expression.ListExpression loop = new Expression.ListExpression();
     Expression fieldStart =
@@ -716,8 +718,8 @@ abstract class JsonReaderCodegen {
           new Expression.Switch.Case(
               i,
               new Expression.ListExpression(
-                  new Expression.Assign(
-                      arguments[fields[i].argumentIndex()], readCreatorValue(fields[i], i)),
+                  assignCreatorArgument(
+                      arguments, fields[i].argumentIndex(), readCreatorValue(fields[i], i)),
                   new Expression.Break()));
     }
     loop.add(
@@ -742,10 +744,10 @@ abstract class JsonReaderCodegen {
         new Expression.If(
             ne(anyMap, new Expression.Null(TypeRef.of(Map.class), false)),
             new Expression.ListExpression(
-                finished, new Expression.Assign(arguments[any.constructionIndex()], finished))));
+                finished, assignCreatorArgument(arguments, any.constructionIndex(), finished))));
     expressions.add(reserveObject(objectOwner));
     expressions.add(new Expression.Invoke(readerRef(), "exitDepth"));
-    expressions.add(new Expression.Return(createValue(type, arguments)));
+    expressions.add(finishCreator(builder, type, creatorInfo, arguments));
     return expressions;
   }
 
@@ -791,7 +793,8 @@ abstract class JsonReaderCodegen {
                 eq(match, Expression.Literal.ofInt(JsonFieldTable.UNKNOWN)), read, skip)));
   }
 
-  private void addCreatorMethod(CodegenContext ctx, Class<?> type, Executable executable) {
+  private void addCreatorMethod(CodegenContext ctx, Class<?> type, JsonCreatorInfo creatorInfo) {
+    Executable executable = creatorInfo.executable();
     Class<?>[] parameterTypes = executable.getParameterTypes();
     Object[] parameters = new Object[parameterTypes.length << 1];
     StringBuilder invocation = new StringBuilder();
@@ -817,7 +820,7 @@ abstract class JsonReaderCodegen {
     if (executable instanceof Method) {
       body.append("value = (").append(typeName).append(") owner.requireCreatorResult(value);\n");
     }
-    if (objectOwner.hasValidators()) {
+    if (objectOwner.hasValidators() && !creatorInfo.hasDeferredFields()) {
       body.append("owner.validateObject(value);\n");
     }
     body.append("return value;");
@@ -908,11 +911,12 @@ abstract class JsonReaderCodegen {
             new Reference("this.selfReader", TypeRef.of(readerCapabilityType())), nestedReader));
   }
 
-  private Expression creatorReadExpression(Class<?> type, JsonCreatorInfo creatorInfo) {
+  private Expression creatorReadExpression(
+      JsonGeneratedCodecBuilder builder, Class<?> type, JsonCreatorInfo creatorInfo) {
     JsonCreatorFieldInfo[] fields = creatorInfo.fields();
     Expression.ListExpression expressions = new Expression.ListExpression();
     expressions.add(new Expression.Invoke(readerRef(), "enterDepth"));
-    Expression[] arguments = creatorArguments(creatorInfo.executable(), expressions);
+    CreatorArguments arguments = creatorArguments(creatorInfo, expressions);
     expressions.add(expectExpr('{'));
     expressions.add(
         new Expression.If(
@@ -920,31 +924,22 @@ abstract class JsonReaderCodegen {
             new Expression.ListExpression(
                 reserveObject(objectOwner),
                 new Expression.Invoke(readerRef(), "exitDepth"),
-                new Expression.Return(createValue(type, arguments)))));
+                finishCreator(builder, type, creatorInfo, arguments))));
 
     Expression.ListExpression loop = new Expression.ListExpression();
-    Expression hash = readFieldNameHash("creatorFieldHash");
-    Expression fieldIndex =
+    Reference fieldIndex = new Reference("creatorFieldIndex", TypeRef.of(int.class));
+    loop.add(
         new Expression.Variable(
-            "creatorFieldIndex",
-            new Expression.Invoke(
-                    fieldRef("creator", JsonCreatorInfo.class),
-                    "index",
-                    TypeRef.of(int.class),
-                    true,
-                    hash)
-                .inline());
-    loop.add(hash);
-    loop.add(fieldIndex);
-    loop.add(expectExpr(':'));
+            "creatorFieldIndex", Expression.Literal.ofInt(JsonFieldTable.UNKNOWN)));
+    loop.add(readCreatorFieldIndex(fieldIndex, fields));
     Expression.Switch.Case[] cases = new Expression.Switch.Case[fields.length];
     for (int i = 0; i < fields.length; i++) {
       cases[i] =
           new Expression.Switch.Case(
               i,
               new Expression.ListExpression(
-                  new Expression.Assign(
-                      arguments[fields[i].argumentIndex()], readCreatorValue(fields[i], i)),
+                  assignCreatorArgument(
+                      arguments, fields[i].argumentIndex(), readCreatorValue(fields[i], i)),
                   new Expression.Break()));
     }
     loop.add(
@@ -956,28 +951,158 @@ abstract class JsonReaderCodegen {
     expressions.add(new Expression.While(Expression.Literal.True, loop));
     expressions.add(reserveObject(objectOwner));
     expressions.add(new Expression.Invoke(readerRef(), "exitDepth"));
-    expressions.add(new Expression.Return(createValue(type, arguments)));
+    expressions.add(finishCreator(builder, type, creatorInfo, arguments));
     return expressions;
   }
 
-  private Expression[] creatorArguments(
-      Executable executable, Expression.ListExpression expressions) {
+  private Expression readCreatorFieldIndex(Expression fieldIndex, JsonCreatorFieldInfo[] fields) {
+    Expression hash = readFieldNameHash("creatorFieldHash");
+    Expression fallback =
+        new Expression.ListExpression(
+            hash,
+            new Expression.Assign(
+                fieldIndex,
+                new Expression.Invoke(
+                        fieldRef("creator", JsonCreatorInfo.class),
+                        "index",
+                        TypeRef.of(int.class),
+                        true,
+                        hash)
+                    .inline()),
+            expectExpr(':'));
+    if (!rawFieldNameDispatch() || !hasDirectCreatorFieldName(fields)) {
+      return fallback;
+    }
+    Expression prefix =
+        new Expression.Invoke(
+            readerRef(), "readFieldNamePrefix", "creatorFieldPrefix", TypeRef.of(int.class), false);
+    // A complete direct token consumes the colon. A miss leaves the name unread, so the existing
+    // hash path retains whitespace, escape, unknown-name, collision, and malformed-input behavior.
+    return new Expression.ListExpression(
+        prefix,
+        directCreatorFieldNameSwitch(fieldIndex, prefix, fields),
+        new Expression.If(
+            eq(fieldIndex, Expression.Literal.ofInt(JsonFieldTable.UNKNOWN)), fallback));
+  }
+
+  private CreatorArguments creatorArguments(
+      JsonCreatorInfo creatorInfo, Expression.ListExpression expressions) {
     // Creator fields cover only read-enabled JSON members. The executable owns the full argument
     // shape, including ignored or getter-only parameters which must still receive typed defaults.
+    Executable executable = creatorInfo.executable();
     Class<?>[] parameterTypes = executable.getParameterTypes();
-    Expression[] arguments = new Expression[parameterTypes.length];
+    JsonFieldInfo[] deferredFields = creatorInfo.deferredFields();
+    int argumentCount = parameterTypes.length;
+    Expression[] values = new Expression[argumentCount + deferredFields.length];
+    Expression[] present =
+        creatorInfo.tracksArgumentPresence() ? new Expression[values.length] : null;
+    for (int i = 0; i < values.length; i++) {
+      Class<?> valueType =
+          i < argumentCount ? parameterTypes[i] : deferredFields[i - argumentCount].readRawType();
+      values[i] = new Expression.Variable("a" + i, creatorDefault(valueType));
+      expressions.add(values[i]);
+      if (present != null) {
+        present[i] = new Expression.Variable("p" + i, Expression.Literal.False);
+        expressions.add(present[i]);
+      }
+    }
+    return new CreatorArguments(values, present);
+  }
+
+  private Expression assignCreatorArgument(
+      CreatorArguments arguments, int index, Expression value) {
+    Expression assign = new Expression.Assign(arguments.values[index], value);
+    if (arguments.present == null) {
+      return assign;
+    }
+    return new Expression.ListExpression(
+        assign, new Expression.Assign(arguments.present[index], Expression.Literal.True));
+  }
+
+  private Expression resolveMissingArguments(
+      JsonCreatorInfo creatorInfo, CreatorArguments arguments) {
+    if (arguments.present == null) {
+      return new Expression.ListExpression();
+    }
+    Class<?>[] parameterTypes = creatorInfo.executable().getParameterTypes();
+    Expression.ListExpression expressions = new Expression.ListExpression();
     for (int i = 0; i < parameterTypes.length; i++) {
-      arguments[i] = new Expression.Variable("a" + i, creatorDefault(parameterTypes[i]));
-      expressions.add(arguments[i]);
+      Expression defaultValue = creatorDefaultValue(creatorInfo, arguments, i, parameterTypes[i]);
+      expressions.add(
+          new Expression.If(
+              not(arguments.present[i]), new Expression.Assign(arguments.values[i], defaultValue)));
+    }
+    return expressions;
+  }
+
+  private Expression creatorDefaultValue(
+      JsonCreatorInfo creatorInfo, CreatorArguments arguments, int index, Class<?> parameterType) {
+    Method method = creatorInfo.defaultMethod(index);
+    if (method == null) {
+      return new Expression.Cast(
+          new Expression.Invoke(
+              fieldRef("creator", JsonCreatorInfo.class),
+              "defaultValue",
+              TypeRef.of(Object.class),
+              Expression.Literal.ofInt(index),
+              new Expression.Null(TypeRef.of(Object[].class), false)),
+          TypeRef.of(parameterType));
+    }
+    Class<?>[] dependencies = method.getParameterTypes();
+    Expression[] inputs = new Expression[dependencies.length];
+    for (int i = 0; i < dependencies.length; i++) {
+      inputs[i] = new Expression.Cast(arguments.values[i], TypeRef.of(dependencies[i])).inline();
+    }
+    Expression value =
+        new Expression.StaticInvoke(
+            method.getDeclaringClass(),
+            method.getName(),
+            TypeRef.of(method.getReturnType()),
+            inputs);
+    return new Expression.Cast(value, TypeRef.of(parameterType));
+  }
+
+  private Expression finishCreator(
+      JsonGeneratedCodecBuilder builder,
+      Class<?> type,
+      JsonCreatorInfo creatorInfo,
+      CreatorArguments arguments) {
+    Expression.ListExpression expressions = new Expression.ListExpression();
+    expressions.add(resolveMissingArguments(creatorInfo, arguments));
+    Expression[] constructorArguments =
+        Arrays.copyOf(arguments.values, creatorInfo.argumentCount());
+    Expression value = new Expression.Variable("value", createValue(type, constructorArguments));
+    expressions.add(value);
+    JsonFieldInfo[] deferredFields = creatorInfo.deferredFields();
+    for (int i = 0; i < deferredFields.length; i++) {
+      int slot = creatorInfo.argumentCount() + i;
+      expressions.add(
+          new Expression.If(
+              arguments.present[slot],
+              builder.setField(deferredFields[i], value, arguments.values[slot])));
+    }
+    if (creatorInfo.hasDeferredFields() && objectOwner.hasValidators()) {
+      expressions.add(new Expression.Invoke(ownerRef(), "validateObject", value));
+    }
+    expressions.add(new Expression.Return(value));
+    return expressions;
+  }
+
+  private static final class CreatorArguments {
+    private final Expression[] values;
+    private final Expression[] present;
+
+    private CreatorArguments(Expression[] values, Expression[] present) {
+      this.values = values;
+      this.present = present;
     }
-    return arguments;
   }
 
   private void addUnwrappedCreatorMethods(
       CodegenContext ctx, Class<?> rootType, JsonCreatorInfo rootCreator, Group[] groups) {
     if (rootCreator != null) {
       addWorkspaceCreatorMethod(
-          ctx, rootType, rootCreator.executable(), unwrappedCreatorMethod(-1), "owner");
+          ctx, rootType, rootCreator, unwrappedCreatorMethod(-1), "owner", "this.creator");
     }
     for (int i = 0; i < groups.length; i++) {
       ObjectCodec<?> child = groups[i].childCodec();
@@ -986,9 +1111,10 @@ abstract class JsonReaderCodegen {
         addWorkspaceCreatorMethod(
             ctx,
             child.type(),
-            creator.executable(),
+            creator,
             unwrappedCreatorMethod(i),
-            "this.groupCodecs[" + i + "]");
+            "this.groupCodecs[" + i + "]",
+            "this.groupCodecs[" + i + "].creatorInfo()");
       }
     }
   }
@@ -996,9 +1122,11 @@ abstract class JsonReaderCodegen {
   private void addWorkspaceCreatorMethod(
       CodegenContext ctx,
       Class<?> type,
-      Executable executable,
+      JsonCreatorInfo creator,
       String methodName,
-      String codecExpression) {
+      String codecExpression,
+      String creatorExpression) {
+    Executable executable = creator.executable();
     Class<?>[] parameterTypes = executable.getParameterTypes();
     StringBuilder invocation = new StringBuilder();
     for (int i = 0; i < parameterTypes.length; i++) {
@@ -1021,6 +1149,7 @@ abstract class JsonReaderCodegen {
             ? "new " + typeName + "(" + invocation + ")"
             : typeName + "." + ((Method) executable).getName() + "(" + invocation + ")";
     StringBuilder body = new StringBuilder();
+    appendWorkspaceDefaults(ctx, body, creator, creatorExpression, parameterTypes);
     body.append(typeName)
         .append(" value;\ntry {\n  value = ")
         .append(expression)
@@ -1040,6 +1169,54 @@ abstract class JsonReaderCodegen {
     ctx.addMethod("private final", methodName, body.toString(), type, Object[].class, "arguments");
   }
 
+  private void appendWorkspaceDefaults(
+      CodegenContext ctx,
+      StringBuilder body,
+      JsonCreatorInfo creator,
+      String creatorExpression,
+      Class<?>[] parameterTypes) {
+    for (int i = 0; i < parameterTypes.length; i++) {
+      Method method = creator.defaultMethod(i);
+      body.append("if (")
+          .append(ctx.type(JsonCreatorInfo.class))
+          .append(".isMissing(arguments[")
+          .append(i)
+          .append("])) {\n  ");
+      if (method == null) {
+        body.append("throw ")
+            .append(creatorExpression)
+            .append(".missingArgument(")
+            .append(i)
+            .append(");\n");
+      } else {
+        body.append("arguments[")
+            .append(i)
+            .append("] = ")
+            .append(ctx.type(method.getDeclaringClass()))
+            .append('.')
+            .append(method.getName())
+            .append('(');
+        Class<?>[] dependencies = method.getParameterTypes();
+        for (int j = 0; j < dependencies.length; j++) {
+          if (j != 0) {
+            body.append(", ");
+          }
+          Class<?> castType =
+              dependencies[j].isPrimitive()
+                  ? TypeUtils.boxedType(dependencies[j])
+                  : dependencies[j];
+          body.append("((")
+              .append(ctx.type(castType))
+              .append(") arguments[")
+              .append(j)
+              .append("])");
+        }
+        body.append(");\n");
+      }
+      body.append("}\n");
+    }
+  }
+
   private String unwrappedCreatorMethod(int groupIndex) {
     return groupIndex < 0 ? "createUnwrappedRoot" : "createUnwrappedGroup" + groupIndex;
   }
@@ -1557,18 +1734,55 @@ abstract class JsonReaderCodegen {
     return new Expression.Variable("object", inline(value));
   }
 
-  private Expression finishUnwrappedRoot(Expression root, Class<?> type, JsonCreatorInfo creator) {
+  private Expression finishUnwrappedRoot(
+      JsonGeneratedCodecBuilder builder, Expression root, Class<?> type, JsonCreatorInfo creator) {
     if (creator == null) {
       return root;
     }
-    return new Expression.Invoke(
-        new Reference("this", TypeRef.of(Object.class)),
-        unwrappedCreatorMethod(-1),
-        "",
-        TypeRef.of(type),
-        false,
-        false,
-        new Expression.Cast(root, TypeRef.of(Object[].class)));
+    Expression workspace = new Expression.Cast(root, TypeRef.of(Object[].class));
+    Expression constructed =
+        new Expression.Invoke(
+            new Reference("this", TypeRef.of(Object.class)),
+            unwrappedCreatorMethod(-1),
+            "",
+            TypeRef.of(type),
+            false,
+            false,
+            workspace);
+    return finishWorkspaceObject(builder, creator, type, constructed, workspace, "constructedRoot");
+  }
+
+  private Expression finishWorkspaceObject(
+      JsonGeneratedCodecBuilder builder,
+      JsonCreatorInfo creator,
+      Class<?> type,
+      Expression constructed,
+      Expression workspace,
+      String name) {
+    if (!creator.hasDeferredFields()) {
+      return constructed;
+    }
+    Expression value =
+        new Expression.Variable(name, new Expression.Cast(constructed, TypeRef.of(type)));
+    Expression.ListExpression expressions = new Expression.ListExpression(value);
+    JsonFieldInfo[] deferredFields = creator.deferredFields();
+    for (int i = 0; i < deferredFields.length; i++) {
+      JsonFieldInfo field = deferredFields[i];
+      Expression deferred =
+          new Expression.Variable(
+              name + "Deferred" + i,
+              new Expression.ArrayValue(
+                  new Expression.Cast(workspace, TypeRef.of(Object[].class)),
+                  Expression.Literal.ofInt(creator.deferredSlot(i))));
+      Expression missing =
+          new Expression.StaticInvoke(
+              JsonCreatorInfo.class, "isMissing", TypeRef.of(boolean.class), deferred);
+      Expression typed = new Expression.Cast(deferred, TypeRef.of(field.readRawType()));
+      expressions.add(
+          deferred, new Expression.If(not(missing), builder.setField(field, value, typed)));
+    }
+    expressions.add(value);
+    return expressions;
   }
 
   private Expression.ListExpression unwrappedMembers(
@@ -2176,7 +2390,7 @@ abstract class JsonReaderCodegen {
     Expression workspace = new Expression.ArrayValue(workspaces, Expression.Literal.ofInt(index));
     Expression child;
     if (childCodec.creatorInfo() != null) {
-      child =
+      Expression constructed =
           new Expression.Invoke(
               new Reference("this", TypeRef.of(Object.class)),
               unwrappedCreatorMethod(index),
@@ -2185,6 +2399,14 @@ abstract class JsonReaderCodegen {
               false,
               false,
               new Expression.Cast(workspace, TypeRef.of(Object[].class)));
+      child =
+          finishWorkspaceObject(
+              builder,
+              childCodec.creatorInfo(),
+              childCodec.type(),
+              constructed,
+              workspace,
+              "constructedGroup" + index);
     } else {
       child = workspace;
     }
@@ -2446,7 +2668,7 @@ abstract class JsonReaderCodegen {
       Expression[] skips) {
     if (isDirectName(properties[index].name(), true)) {
       return statementIf(
-          tryReadNextFieldNameColon(properties[index], true),
+          tryReadNextFieldNameColon(properties[index].name()),
           new Expression.ListExpression(
               readField(builder, type, properties[index], index, object, true),
               fieldEnd(slowMethod, properties.length, groupEnd, groupHelper, index, object)),
@@ -2481,7 +2703,7 @@ abstract class JsonReaderCodegen {
     int nextIndex = index + 1;
     if (nextIndex < groupEnd && isDirectName(properties[nextIndex].name(), true)) {
       return statementIf(
-          tryReadNextFieldNameColon(properties[nextIndex], true),
+          tryReadNextFieldNameColon(properties[nextIndex].name()),
           new Expression.ListExpression(
               readField(builder, type, properties[nextIndex], nextIndex, object, true),
               new Expression.Assign(skips[nextIndex], Expression.Literal.True),
@@ -3019,15 +3241,33 @@ abstract class JsonReaderCodegen {
     return false;
   }
 
+  private boolean hasDirectCreatorFieldName(JsonCreatorFieldInfo[] fields) {
+    for (JsonCreatorFieldInfo field : fields) {
+      if (!field.name().isEmpty() && isDirectName(field.name(), true)) {
+        return true;
+      }
+    }
+    return false;
+  }
+
   private Expression directFieldNameSwitch(
       Expression fieldIndex, Expression prefix, JsonFieldInfo[] properties) {
-    int[] keys = new int[properties.length];
+    String[] names = new String[properties.length];
+    for (int i = 0; i < properties.length; i++) {
+      names[i] = properties[i].name();
+    }
+    return directFieldNameSwitch(fieldIndex, prefix, names);
+  }
+
+  private Expression directFieldNameSwitch(
+      Expression fieldIndex, Expression prefix, String[] names) {
+    int[] keys = new int[names.length];
     int keyCount = 0;
-    for (JsonFieldInfo property : properties) {
-      if (property.name().isEmpty() || !isDirectName(property.name(), true)) {
+    for (String name : names) {
+      if (name.isEmpty() || !isDirectName(name, true)) {
         continue;
       }
-      int key = (int) JsonAsciiToken.prefix(fieldNameToken(property.name()));
+      int key = (int) JsonAsciiToken.prefix(fieldNameToken(name));
       boolean found = false;
       for (int i = 0; i < keyCount; i++) {
         if (keys[i] == key) {
@@ -3043,14 +3283,14 @@ abstract class JsonReaderCodegen {
     for (int keyIndex = 0; keyIndex < keyCount; keyIndex++) {
       int key = keys[keyIndex];
       Expression resolve = new Expression.Empty();
-      for (int field = properties.length - 1; field >= 0; field--) {
-        JsonFieldInfo property = properties[field];
-        if (!property.name().isEmpty()
-            && isDirectName(property.name(), true)
-            && (int) JsonAsciiToken.prefix(fieldNameToken(property.name())) == key) {
+      for (int field = names.length - 1; field >= 0; field--) {
+        String name = names[field];
+        if (!name.isEmpty()
+            && isDirectName(name, true)
+            && (int) JsonAsciiToken.prefix(fieldNameToken(name)) == key) {
           resolve =
               new Expression.If(
-                  tryReadNextFieldNameColon(property, true),
+                  tryReadNextFieldNameColon(name),
                   new Expression.Assign(fieldIndex, Expression.Literal.ofInt(field)),
                   resolve);
         }
@@ -3062,6 +3302,15 @@ abstract class JsonReaderCodegen {
     return new Expression.Switch(prefix, cases, null);
   }
 
+  private Expression directCreatorFieldNameSwitch(
+      Expression fieldIndex, Expression prefix, JsonCreatorFieldInfo[] fields) {
+    String[] names = new String[fields.length];
+    for (int i = 0; i < fields.length; i++) {
+      names[i] = fields[i].name();
+    }
+    return directFieldNameSwitch(fieldIndex, prefix, names);
+  }
+
   private Expression fieldSwitch(
       JsonGeneratedCodecBuilder builder,
       Class<?> type,
@@ -3528,8 +3777,8 @@ abstract class JsonReaderCodegen {
         .inline();
   }
 
-  final Expression tryReadAsciiFieldNameColon(JsonFieldInfo property) {
-    String token = fieldNameToken(property.name());
+  final Expression tryReadAsciiFieldNameColon(String name) {
+    String token = fieldNameToken(name);
     int tokenLength = token.length();
     int suffixLength = JsonAsciiToken.suffixLength(tokenLength);
     // Whitespace, escapes, and UTF8 spellings that do not match the raw token fall through without
@@ -3566,48 +3815,30 @@ abstract class JsonReaderCodegen {
         .inline();
   }
 
-  final Expression tryReadUtf16FieldNameColon(JsonFieldInfo property, boolean tokenValueRead) {
-    String name = property.name();
-    int length = name.length();
-    if (tokenValueRead) {
-      String token = fieldNameToken(name);
-      int tokenLength = token.length();
-      int tailLength = Math.max(0, tokenLength - 4);
-      if (tokenLength <= 8) {
-        return new Expression.Invoke(
-                readerRef(),
-                "tryReadNextFieldNameUtf16Token2",
-                TypeRef.of(boolean.class),
-                Expression.Literal.ofLong(utf16TokenWord(token, 0, Math.min(tokenLength, 4))),
-                Expression.Literal.ofLong(utf16WordMask(Math.min(tokenLength, 4))),
-                Expression.Literal.ofLong(
-                    tailLength == 0 ? 0 : utf16TokenWord(token, 4, tailLength)),
-                Expression.Literal.ofLong(tailLength == 0 ? 0 : utf16WordMask(tailLength)),
-                Expression.Literal.ofInt(tokenLength))
-            .inline();
-      }
+  final Expression tryReadUtf16FieldNameColon(String name) {
+    String token = fieldNameToken(name);
+    int tokenLength = token.length();
+    int tailLength = Math.max(0, tokenLength - 4);
+    if (tokenLength <= 8) {
       return new Expression.Invoke(
               readerRef(),
-              "tryReadNextFieldNameUtf16Token3",
+              "tryReadNextFieldNameUtf16Token2",
               TypeRef.of(boolean.class),
-              Expression.Literal.ofLong(utf16TokenWord(token, 0, 4)),
-              Expression.Literal.ofLong(utf16TokenWord(token, 4, 4)),
-              Expression.Literal.ofLong(utf16TokenWord(token, 8, tokenLength - 8)),
+              Expression.Literal.ofLong(utf16TokenWord(token, 0, Math.min(tokenLength, 4))),
+              Expression.Literal.ofLong(utf16WordMask(Math.min(tokenLength, 4))),
+              Expression.Literal.ofLong(tailLength == 0 ? 0 : utf16TokenWord(token, 4, tailLength)),
+              Expression.Literal.ofLong(tailLength == 0 ? 0 : utf16WordMask(tailLength)),
               Expression.Literal.ofInt(tokenLength))
           .inline();
     }
-    int tailLength = Math.max(0, length - 4);
     return new Expression.Invoke(
             readerRef(),
-            "tryReadNextFieldNameUtf16",
+            "tryReadNextFieldNameUtf16Token3",
             TypeRef.of(boolean.class),
-            Expression.Literal.ofLong(property.nameHash()),
-            Expression.Literal.ofLong(packedNameMask(length)),
-            Expression.Literal.ofLong(utf16NameWord(name, 0, Math.min(length, 4))),
-            Expression.Literal.ofLong(utf16WordMask(Math.min(length, 4))),
-            Expression.Literal.ofLong(tailLength == 0 ? 0 : utf16NameWord(name, 4, tailLength)),
-            Expression.Literal.ofLong(tailLength == 0 ? 0 : utf16WordMask(tailLength)),
-            Expression.Literal.ofInt(length))
+            Expression.Literal.ofLong(utf16TokenWord(token, 0, 4)),
+            Expression.Literal.ofLong(utf16TokenWord(token, 4, 4)),
+            Expression.Literal.ofLong(utf16TokenWord(token, 8, tokenLength - 8)),
+            Expression.Literal.ofInt(tokenLength))
         .inline();
   }
 
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonWriterCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonWriterCodegen.java
index f00e564a2..5f20e42b9 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonWriterCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/JsonWriterCodegen.java
@@ -846,7 +846,9 @@ abstract class JsonWriterCodegen {
 
   private static boolean usesWriteInfo(JsonFieldInfo property) {
     JsonFieldKind kind = property.writeKind();
-    return kind == JsonFieldKind.BOOLEAN || kind == JsonFieldKind.ENUM;
+    return kind == JsonFieldKind.BOOLEAN
+        || kind == JsonFieldKind.ENUM
+        || property.requiresNonNullWrite();
   }
 
   private Expression writerConstructorExpression(
@@ -901,7 +903,10 @@ abstract class JsonWriterCodegen {
       index = new Expression.Variable("index", Expression.Literal.ofInt(0));
       JsonFieldInfo first = properties.length == 0 ? null : properties[0];
       Expression value =
-          first != null && !first.writeNull() && first.writeKind() == JsonFieldKind.STRING
+          first != null
+                  && !first.writeNull()
+                  && !first.requiresNonNullWrite()
+                  && first.writeKind() == JsonFieldKind.STRING
               ? new Expression.Variable(
                   "v0", cast(inline(builder.fieldValue(first, object)), TypeRef.of(String.class)))
               : null;
@@ -1001,6 +1006,7 @@ abstract class JsonWriterCodegen {
           any.writeIndex() > 0
                   && first != null
                   && !first.writeNull()
+                  && !first.requiresNonNullWrite()
                   && first.writeKind() == JsonFieldKind.STRING
               ? new Expression.Variable(
                   "v0", cast(inline(builder.fieldValue(first, object)), TypeRef.of(String.class)))
@@ -1253,6 +1259,11 @@ abstract class JsonWriterCodegen {
       Expression object,
       Expression writer) {
     Class<?> rawType = property.writeRawType();
+    if (rawType == void.class) {
+      return new Expression.ListExpression(
+          writeFieldName(property, id, commaKnown, index, writer),
+          new Expression.Invoke(writer, "writeNull"));
+    }
     if (rawType.isPrimitive()) {
       // Primitive members cannot be null and this path consumes the access once. Nullable
       // references stay cached below because their null check and write must share one value.
@@ -1305,6 +1316,14 @@ abstract class JsonWriterCodegen {
             : new Expression.ListExpression(
                 writeFieldName(property, id, commaKnown, index, writer),
                 writeValue(property, id, value, true, index, writer));
+    if (property.requiresNonNullWrite()) {
+      return new Expression.ListExpression(
+          value,
+          new Expression.If(
+              eq(value, nullValue),
+              new Expression.Invoke(fieldRef("wp" + id, JsonFieldInfo.class), "rejectNullWrite"),
+              write));
+    }
     return new Expression.ListExpression(value, new Expression.If(ne(value, nullValue), write));
   }
 
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Latin1ReaderCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Latin1ReaderCodegen.java
index b2b66dfbf..0e8d42472 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Latin1ReaderCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Latin1ReaderCodegen.java
@@ -104,8 +104,8 @@ final class Latin1ReaderCodegen extends JsonReaderCodegen {
   }
 
   @Override
-  Expression tryReadNextFieldNameColon(JsonFieldInfo property, boolean tokenValueRead) {
-    return tryReadAsciiFieldNameColon(property);
+  Expression tryReadNextFieldNameColon(String name) {
+    return tryReadAsciiFieldNameColon(name);
   }
 
   @Override
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf16ReaderCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf16ReaderCodegen.java
index 8dfa82985..3638731e2 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf16ReaderCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf16ReaderCodegen.java
@@ -87,8 +87,8 @@ final class Utf16ReaderCodegen extends JsonReaderCodegen {
   }
 
   @Override
-  Expression tryReadNextFieldNameColon(JsonFieldInfo property, boolean tokenValueRead) {
-    return tryReadUtf16FieldNameColon(property, tokenValueRead);
+  Expression tryReadNextFieldNameColon(String name) {
+    return tryReadUtf16FieldNameColon(name);
   }
 
   @Override
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8ReaderCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8ReaderCodegen.java
index 953e0ce18..8bf2a4c5b 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8ReaderCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8ReaderCodegen.java
@@ -224,8 +224,8 @@ final class Utf8ReaderCodegen extends JsonReaderCodegen {
   }
 
   @Override
-  Expression tryReadNextFieldNameColon(JsonFieldInfo property, boolean tokenValueRead) {
-    return tryReadAsciiFieldNameColon(property);
+  Expression tryReadNextFieldNameColon(String name) {
+    return tryReadAsciiFieldNameColon(name);
   }
 
   @Override
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8WriterCodegen.java b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8WriterCodegen.java
index bf5de280f..1a92aa164 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8WriterCodegen.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/codegen/Utf8WriterCodegen.java
@@ -110,6 +110,7 @@ final class Utf8WriterCodegen extends JsonWriterCodegen {
         if (i == 0
             && !objectStartFused
             && !property.writeNull()
+            && !property.requiresNonNullWrite()
             && canPackObjectStartString(property)) {
           // The generated first-field branch consumes neither ordinary prefix field.
         } else if (objectStartFused && i == 0) {
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonCreatorInfo.java b/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonCreatorInfo.java
index 5a7e564c3..532ae9c94 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonCreatorInfo.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonCreatorInfo.java
@@ -20,6 +20,7 @@
 package org.apache.fory.json.meta;
 
 import java.lang.invoke.MethodHandle;
+import java.lang.invoke.MethodHandles;
 import java.lang.invoke.MethodType;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.Executable;
@@ -60,6 +61,11 @@ public final class JsonCreatorInfo {
   private final long[] hashes;
   private final MethodHandle invoker;
   private final GeneratedJsonCodec<?> generatedCodec;
+  private final Method[] defaultMethods;
+  private final MethodHandle[] defaultInvokers;
+  private final String[] parameterNames;
+  private final JsonFieldInfo[] deferredFields;
+  private static final Object MISSING = new Object();
 
   public JsonCreatorInfo(
       Class<?> ownerType,
@@ -67,18 +73,123 @@ public final class JsonCreatorInfo {
       JsonCreatorFieldInfo[] fields,
       Object[] defaults,
       GeneratedJsonCodec<?> generatedCodec) {
+    this(ownerType, executable, fields, defaults, generatedCodec, null, null, null);
+  }
+
+  public JsonCreatorInfo(
+      Class<?> ownerType,
+      Executable executable,
+      JsonCreatorFieldInfo[] fields,
+      Object[] defaults,
+      GeneratedJsonCodec<?> generatedCodec,
+      Method[] defaultMethods,
+      String[] parameterNames) {
+    this(
+        ownerType,
+        executable,
+        fields,
+        defaults,
+        generatedCodec,
+        defaultMethods,
+        parameterNames,
+        null);
+  }
+
+  private JsonCreatorInfo(
+      Class<?> ownerType,
+      Executable executable,
+      JsonCreatorFieldInfo[] fields,
+      Object[] defaults,
+      GeneratedJsonCodec<?> generatedCodec,
+      Method[] defaultMethods,
+      String[] parameterNames,
+      JsonFieldInfo[] deferredFields) {
     this.ownerType = ownerType;
     this.executable = executable;
-    this.fields = fields;
+    this.deferredFields = deferredFields == null ? new JsonFieldInfo[0] : deferredFields;
+    if (this.deferredFields.length == 0) {
+      this.fields = fields;
+    } else {
+      this.fields = Arrays.copyOf(fields, fields.length + this.deferredFields.length);
+      for (int i = 0; i < this.deferredFields.length; i++) {
+        this.fields[fields.length + i] = this.deferredFields[i].asCreatorField(defaults.length + i);
+      }
+    }
     this.defaults = defaults;
     this.generatedCodec = generatedCodec;
-    invoker = generatedCodec == null ? buildInvoker(executable) : null;
+    this.parameterNames = parameterNames == null ? null : parameterNames.clone();
+    this.defaultMethods = defaultMethods == null ? null : defaultMethods.clone();
+    defaultInvokers =
+        this.defaultMethods == null
+            ? null
+            : buildDefaultInvokers(ownerType, executable, this.defaultMethods);
+    invoker =
+        generatedCodec == null
+            ? buildInvoker(executable, defaults.length + this.deferredFields.length)
+            : null;
+    hashes = new long[this.fields.length];
+    for (int i = 0; i < this.fields.length; i++) {
+      hashes[i] = this.fields[i].nameHash();
+    }
+  }
+
+  private JsonCreatorInfo(
+      JsonCreatorInfo source,
+      JsonFieldInfo[] deferredFields,
+      JsonFieldInfo[] directDeferredFields) {
+    ownerType = source.ownerType;
+    executable = source.executable;
+    defaults = source.defaults;
+    generatedCodec = source.generatedCodec;
+    defaultMethods = source.defaultMethods;
+    defaultInvokers = source.defaultInvokers;
+    parameterNames = source.parameterNames;
+    this.deferredFields = deferredFields;
+    fields = Arrays.copyOf(source.fields, source.fields.length + directDeferredFields.length);
+    for (int i = 0; i < directDeferredFields.length; i++) {
+      int deferredIndex = identityIndex(deferredFields, directDeferredFields[i]);
+      if (deferredIndex < 0) {
+        throw new IllegalArgumentException(
+            "Direct deferred field is not in the deferred field set");
+      }
+      fields[source.fields.length + i] =
+          directDeferredFields[i].asCreatorField(defaults.length + deferredIndex);
+    }
+    invoker =
+        generatedCodec == null
+            ? buildInvoker(executable, defaults.length + deferredFields.length)
+            : null;
     hashes = new long[fields.length];
     for (int i = 0; i < fields.length; i++) {
       hashes[i] = fields[i].nameHash();
     }
   }
 
+  /** Returns immutable construction metadata extended with post-constructor mutable properties. */
+  public JsonCreatorInfo withDeferredFields(JsonFieldInfo[] fields) {
+    return withDeferredFields(fields, fields);
+  }
+
+  /** Extends construction with all deferred properties and their directly named JSON subset. */
+  public JsonCreatorInfo withDeferredFields(JsonFieldInfo[] fields, JsonFieldInfo[] directFields) {
+    if (fields.length == 0) {
+      return this;
+    }
+    if (deferredFields.length != 0) {
+      throw new IllegalStateException("Deferred JSON properties are already installed");
+    }
+    return new JsonCreatorInfo(this, fields.clone(), directFields.clone());
+  }
+
+  private static int identityIndex(JsonFieldInfo[] fields, JsonFieldInfo target) {
+    for (int i = 0; i < fields.length; i++) {
+      if (fields[i] == target) {
+        return i;
+      }
+    }
+    return -1;
+  }
+
   public Executable executable() {
     return executable;
   }
@@ -87,8 +198,35 @@ public final class JsonCreatorInfo {
     return fields;
   }
 
+  /** Returns post-constructor mutable properties in construction-workspace order. */
+  public JsonFieldInfo[] deferredFields() {
+    return deferredFields;
+  }
+
+  /** Returns the construction-workspace slot for a deferred property. */
+  public int deferredSlot(int index) {
+    return defaults.length + index;
+  }
+
+  /** Returns the number of arguments passed to the constructor or factory. */
+  public int argumentCount() {
+    return defaults.length;
+  }
+
+  /** Returns whether construction includes post-constructor mutable properties. */
+  public boolean hasDeferredFields() {
+    return deferredFields.length != 0;
+  }
+
   public Object[] newArguments() {
-    return Arrays.copyOf(defaults, defaults.length);
+    Object[] arguments = Arrays.copyOf(defaults, defaults.length + deferredFields.length);
+    if (defaultInvokers != null) {
+      Arrays.fill(arguments, 0, defaults.length, MISSING);
+    }
+    if (deferredFields.length != 0) {
+      Arrays.fill(arguments, defaults.length, arguments.length, MISSING);
+    }
+    return arguments;
   }
 
   public int index(long hash) {
@@ -109,34 +247,173 @@ public final class JsonCreatorInfo {
   }
 
   public Object create(Object[] arguments) {
+    prepareArguments(arguments);
+    Object value;
     if (generatedCodec != null) {
       try {
-        return requireResult(generatedCodec.newInstance(arguments));
+        value = requireResult(generatedCodec.newInstance(arguments));
       } catch (Throwable cause) {
         if (cause instanceof Error) {
           throw (Error) cause;
         }
         throw new ForyJsonException("JSON creator failed for " + ownerType.getName(), cause);
       }
+    } else if (invoker != null) {
+      value = invoke(arguments);
+    } else {
+      try {
+        value =
+            executable instanceof Constructor
+                ? ((Constructor<?>) executable).newInstance(arguments)
+                : ((Method) executable).invoke(null, arguments);
+        value = requireResult(value);
+      } catch (InstantiationException | IllegalAccessException e) {
+        throw new ForyJsonException("Failed to invoke JSON creator for " + ownerType.getName(), e);
+      } catch (InvocationTargetException e) {
+        Throwable cause = e.getCause();
+        if (cause instanceof Error) {
+          throw (Error) cause;
+        }
+        throw new ForyJsonException("JSON creator failed for " + ownerType.getName(), cause);
+      }
     }
-    if (invoker != null) {
-      return invoke(arguments);
+    applyDeferred(value, arguments);
+    return value;
+  }
+
+  /** Returns whether generated readers must track the presence of constructor arguments. */
+  @Internal
+  public boolean tracksArgumentPresence() {
+    return defaultInvokers != null || deferredFields.length != 0;
+  }
+
+  /** Returns whether one constructor argument has a language-defined default. */
+  @Internal
+  public boolean hasDefault(int index) {
+    return defaultInvokers != null && defaultInvokers[index] != null;
+  }
+
+  /** Returns one prevalidated language-defined constructor default method. */
+  @Internal
+  public Method defaultMethod(int index) {
+    return defaultMethods == null ? null : defaultMethods[index];
+  }
+
+  /** Evaluates one prevalidated language-defined constructor default. */
+  @Internal
+  public Object defaultValue(int index, Object[] arguments) {
+    MethodHandle invoker = defaultInvokers[index];
+    if (invoker == null) {
+      throw missingArgument(index);
     }
     try {
-      Object value =
-          executable instanceof Constructor
-              ? ((Constructor<?>) executable).newInstance(arguments)
-              : ((Method) executable).invoke(null, arguments);
-      return requireResult(value);
-    } catch (InstantiationException | IllegalAccessException e) {
-      throw new ForyJsonException("Failed to invoke JSON creator for " + ownerType.getName(), e);
-    } catch (InvocationTargetException e) {
-      Throwable cause = e.getCause();
+      return (Object) invoker.invokeExact(arguments);
+    } catch (Throwable cause) {
       if (cause instanceof Error) {
         throw (Error) cause;
       }
-      throw new ForyJsonException("JSON creator failed for " + ownerType.getName(), cause);
+      throw new ForyJsonException(
+          "JSON constructor default failed for " + ownerType.getName(), cause);
+    }
+  }
+
+  /** Creates the missing-required-property failure outside generated common paths. */
+  @Internal
+  public ForyJsonException missingArgument(int index) {
+    String name = parameterNames == null ? Integer.toString(index) : parameterNames[index];
+    return new ForyJsonException(
+        "Missing required JSON constructor property " + name + " for " + ownerType.getName());
+  }
+
+  /** Returns whether one construction-workspace slot has not been read. */
+  @Internal
+  public static boolean isMissing(Object value) {
+    return value == MISSING;
+  }
+
+  private void prepareArguments(Object[] arguments) {
+    if (defaultInvokers == null) {
+      return;
+    }
+    for (int i = 0; i < defaults.length; i++) {
+      if (arguments[i] == MISSING) {
+        arguments[i] = defaultValue(i, arguments);
+      }
+    }
+  }
+
+  private void applyDeferred(Object value, Object[] arguments) {
+    for (int i = 0; i < deferredFields.length; i++) {
+      Object deferred = arguments[defaults.length + i];
+      if (deferred != MISSING) {
+        deferredFields[i].putValue(value, deferred);
+      }
+    }
+  }
+
+  private static MethodHandle[] buildDefaultInvokers(
+      Class<?> ownerType, Executable executable, Method[] defaultMethods) {
+    if (defaultMethods.length != executable.getParameterCount()) {
+      throw new ForyJsonException("Constructor default count does not match " + executable);
+    }
+    MethodHandle[] invokers = new MethodHandle[defaultMethods.length];
+    Class<?>[] parameterTypes = executable.getParameterTypes();
+    for (int i = 0; i < defaultMethods.length; i++) {
+      Method method = defaultMethods[i];
+      if (method == null) {
+        continue;
+      }
+      if ((method.getDeclaringClass() != ownerType
+              || !java.lang.reflect.Modifier.isStatic(method.getModifiers()))
+          || !method.getName().equals("$lessinit$greater$default$" + (i + 1))
+          || method.getParameterCount() > i
+          || !java.lang.reflect.Modifier.isPublic(method.getModifiers())
+          || !boxed(parameterTypes[i]).isAssignableFrom(boxed(method.getReturnType()))) {
+        throw new ForyJsonException("Invalid JSON constructor default method " + method);
+      }
+      Class<?>[] dependencyTypes = method.getParameterTypes();
+      for (int j = 0; j < dependencyTypes.length; j++) {
+        if (dependencyTypes[j] != parameterTypes[j]) {
+          throw new ForyJsonException("Invalid JSON constructor default method " + method);
+        }
+      }
+      try {
+        MethodHandle target =
+            _JDKAccess._trustedLookup(method.getDeclaringClass()).unreflect(method);
+        invokers[i] = workspaceInvoker(target, dependencyTypes);
+      } catch (IllegalAccessException e) {
+        throw new ForyJsonException("Cannot access JSON constructor default " + method, e);
+      }
     }
+    return invokers;
+  }
+
+  private static Class<?> boxed(Class<?> type) {
+    if (!type.isPrimitive()) {
+      return type;
+    }
+    if (type == boolean.class) {
+      return Boolean.class;
+    }
+    if (type == byte.class) {
+      return Byte.class;
+    }
+    if (type == short.class) {
+      return Short.class;
+    }
+    if (type == int.class) {
+      return Integer.class;
+    }
+    if (type == long.class) {
+      return Long.class;
+    }
+    if (type == float.class) {
+      return Float.class;
+    }
+    if (type == double.class) {
+      return Double.class;
+    }
+    return Character.class;
   }
 
   private Object invoke(Object[] arguments) {
@@ -160,14 +437,22 @@ public final class JsonCreatorInfo {
     return value;
   }
 
-  private static MethodHandle buildInvoker(Executable executable) {
+  private static MethodHandle buildInvoker(Executable executable, int workspaceSize) {
     if (AndroidSupport.IS_ANDROID) {
       // Android has no supported trusted MethodHandle lookup. Creator shape validation guarantees
       // a public executable; accessibility is needed only when its declaring class is non-public.
       executable.setAccessible(true);
       return null;
     }
-    return creatorHandle(executable);
+    int parameterCount = executable.getParameterCount();
+    if (workspaceSize == parameterCount) {
+      return creatorHandle(executable);
+    }
+    MethodHandle target =
+        GraalvmSupport.IN_GRAALVM_NATIVE_IMAGE
+            ? nativeCreatorHandles(executable).target
+            : creatorTarget(executable);
+    return workspaceInvoker(target, executable.getParameterTypes());
   }
 
   /** Returns the array-argument invocation handle for one JSON creator. */
@@ -187,6 +472,21 @@ public final class JsonCreatorInfo {
         .asType(MethodType.methodType(Object.class, Object[].class));
   }
 
+  private static MethodHandle workspaceInvoker(MethodHandle target, Class<?>[] parameterTypes) {
+    MethodHandle elementGetter = MethodHandles.arrayElementGetter(Object[].class);
+    MethodHandle[] filters = new MethodHandle[parameterTypes.length];
+    for (int i = 0; i < parameterTypes.length; i++) {
+      filters[i] =
+          MethodHandles.insertArguments(elementGetter, 1, i)
+              .asType(MethodType.methodType(parameterTypes[i], Object[].class));
+    }
+    MethodHandle filtered = MethodHandles.filterArguments(target, 0, filters);
+    int[] reorder = new int[parameterTypes.length];
+    return MethodHandles.permuteArguments(
+            filtered, MethodType.methodType(target.type().returnType(), Object[].class), reorder)
+        .asType(MethodType.methodType(Object.class, Object[].class));
+  }
+
   /** Returns the one-String-argument creator used by a JsonValue representation. */
   @Internal
   public static MethodHandle stringCreatorHandle(Executable executable) {
@@ -208,7 +508,8 @@ public final class JsonCreatorInfo {
         executable.getParameterCount() == 1 && executable.getParameterTypes()[0] == String.class
             ? target.asType(MethodType.methodType(Object.class, String.class))
             : null;
-    return new CreatorHandles(arrayInvoker(target, executable.getParameterCount()), stringInvoker);
+    return new CreatorHandles(
+        target, arrayInvoker(target, executable.getParameterCount()), stringInvoker);
   }
 
   private static MethodHandle creatorTarget(Executable executable) {
@@ -226,10 +527,13 @@ public final class JsonCreatorInfo {
   }
 
   private static final class CreatorHandles {
+    private final MethodHandle target;
     private final MethodHandle arrayInvoker;
     private final MethodHandle stringInvoker;
 
-    private CreatorHandles(MethodHandle arrayInvoker, MethodHandle stringInvoker) {
+    private CreatorHandles(
+        MethodHandle target, MethodHandle arrayInvoker, MethodHandle stringInvoker) {
+      this.target = target;
       this.arrayInvoker = arrayInvoker;
       this.stringInvoker = stringInvoker;
     }
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonFieldInfo.java b/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonFieldInfo.java
index 82d146de4..7d74e7361 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonFieldInfo.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/meta/JsonFieldInfo.java
@@ -75,7 +75,10 @@ public final class JsonFieldInfo {
   private static final int KIND_OBJECT = 14;
   private static final int KIND_CUSTOM_PRIMITIVE = 15;
   private static final int KIND_RAW_STRING = 16;
+  private static final int KIND_NULL = 17;
   private static final int WRITE_NULL_MASK = Integer.MIN_VALUE;
+  private static final int REQUIRE_NON_NULL_MASK = 1 << 30;
+  private static final int READ_INDEX_MASK = REQUIRE_NON_NULL_MASK - 1;
   private static final byte[] TRUE_BYTES = "true".getBytes(StandardCharsets.ISO_8859_1);
   private static final byte[] FALSE_BYTES = "false".getBytes(StandardCharsets.ISO_8859_1);
 
@@ -152,10 +155,8 @@ public final class JsonFieldInfo {
       JsonFormat formatAnnotation,
       boolean rawValue) {
     this.name = name;
-    // The write-null decision and read index are both immutable after ObjectCodec construction.
-    // Packing the flag into the unused sign bit avoids a separate state field. Read schemas are
-    // bounded by Java array indexes, so the remaining 31 bits cover every representable property
-    // table.
+    // Write-null, required-value, and read-index metadata become immutable with ObjectCodec.
+    // Packing both flags above the read index avoids enlarging every field-metadata object.
     readIndexAndWriteNull = writeNull ? WRITE_NULL_MASK : 0;
     nameHash = JsonFieldNameHash.hash(name);
     this.writeField = writeField;
@@ -175,7 +176,12 @@ public final class JsonFieldInfo {
     this.readAccessor = readAccessor;
     writeKind = writeRawType == null ? null : kind(writeRawType);
     readKind = readRawType == null ? null : kind(readRawType);
-    writeKindId = writeKind == null ? 0 : (rawValue ? KIND_RAW_STRING : kindId(writeKind));
+    writeKindId =
+        writeKind == null
+            ? 0
+            : writeRawType == void.class
+                ? KIND_NULL
+                : (rawValue ? KIND_RAW_STRING : kindId(writeKind));
     readPrimitiveKindId = primitiveKindId(readRawType, readKind);
     Type writeElementType =
         writeKind == JsonFieldKind.COLLECTION ? CodecUtils.elementType(writeType) : null;
@@ -274,6 +280,9 @@ public final class JsonFieldInfo {
             formatAnnotation,
             writesRawString());
     copy.setReadIndex(readIndex());
+    if (requiresNonNullWrite()) {
+      copy.requireNonNullWrite();
+    }
     return copy;
   }
 
@@ -286,6 +295,24 @@ public final class JsonFieldInfo {
     return readIndexAndWriteNull < 0;
   }
 
+  /** Marks an omitted null as invalid because construction requires this property. */
+  public void requireNonNullWrite() {
+    if (writeNull() || writeRawType == null || writeRawType.isPrimitive()) {
+      throw new IllegalStateException("Only omitted reference properties can require a value");
+    }
+    readIndexAndWriteNull |= REQUIRE_NON_NULL_MASK;
+  }
+
+  /** Returns whether omission of a null value would make this schema unreadable. */
+  public boolean requiresNonNullWrite() {
+    return (readIndexAndWriteNull & REQUIRE_NON_NULL_MASK) != 0;
+  }
+
+  /** Throws the cold failure used by interpreted and generated writers. */
+  public void rejectNullWrite() {
+    throw new ForyJsonException("Required JSON property " + name + " cannot be null");
+  }
+
   public Field writeField() {
     return writeField;
   }
@@ -400,7 +427,7 @@ public final class JsonFieldInfo {
           resolvedTypeInfo == null
               ? typeResolver.getTypeInfo(writeType, writeRawType)
               : resolvedTypeInfo;
-      if (!rawString) {
+      if (!rawString && writeRawType != void.class) {
         writeKind = writeTypeInfo.kind();
         writeKindId = kindId(writeKind);
       }
@@ -559,6 +586,53 @@ public final class JsonFieldInfo {
     return readPrimitiveKindId == KIND_CUSTOM_PRIMITIVE ? requirePrimitive(value) : value;
   }
 
+  /** Returns constructor-workspace metadata for this deferred mutable property. */
+  public JsonCreatorFieldInfo asCreatorField(int argumentIndex) {
+    return new JsonCreatorFieldInfo(
+        name,
+        argumentIndex,
+        readType,
+        readRawType,
+        codecAnnotation,
+        valueCodecClass,
+        formatAnnotation);
+  }
+
+  /** Assigns one already decoded value through this property's validated read sink. */
+  public void putValue(Object object, Object value) {
+    switch (readPrimitiveKindId) {
+      case KIND_BOOLEAN:
+        readAccessor.putBoolean(object, ((Boolean) requirePrimitive(value)).booleanValue());
+        return;
+      case KIND_BYTE:
+        readAccessor.putByte(object, ((Byte) requirePrimitive(value)).byteValue());
+        return;
+      case KIND_SHORT:
+        readAccessor.putShort(object, ((Short) requirePrimitive(value)).shortValue());
+        return;
+      case KIND_INT:
+        readAccessor.putInt(object, ((Integer) requirePrimitive(value)).intValue());
+        return;
+      case KIND_LONG:
+        readAccessor.putLong(object, ((Long) requirePrimitive(value)).longValue());
+        return;
+      case KIND_FLOAT:
+        readAccessor.putFloat(object, ((Float) requirePrimitive(value)).floatValue());
+        return;
+      case KIND_DOUBLE:
+        readAccessor.putDouble(object, ((Double) requirePrimitive(value)).doubleValue());
+        return;
+      case KIND_CHAR:
+        readAccessor.putChar(object, ((Character) requirePrimitive(value)).charValue());
+        return;
+      case KIND_CUSTOM_PRIMITIVE:
+        readAccessor.putObject(object, requirePrimitive(value));
+        return;
+      default:
+        readAccessor.putObject(object, value);
+    }
+  }
+
   // A custom codec may return null, but primitive storage has no nullable representation. Keep
   // this check at the field owner; built-in primitive fast paths never call it.
   public Object requirePrimitive(Object value) {
@@ -594,11 +668,15 @@ public final class JsonFieldInfo {
   }
 
   public int readIndex() {
-    return readIndexAndWriteNull & Integer.MAX_VALUE;
+    return readIndexAndWriteNull & READ_INDEX_MASK;
   }
 
   public void setReadIndex(int readIndex) {
-    readIndexAndWriteNull = (readIndexAndWriteNull & WRITE_NULL_MASK) | readIndex;
+    if (readIndex < 0 || readIndex > READ_INDEX_MASK) {
+      throw new IllegalArgumentException("Invalid JSON field read index " + readIndex);
+    }
+    readIndexAndWriteNull =
+        (readIndexAndWriteNull & (WRITE_NULL_MASK | REQUIRE_NON_NULL_MASK)) | readIndex;
   }
 
   public JsonTypeInfo writeTypeInfo() {
@@ -681,6 +759,10 @@ public final class JsonFieldInfo {
 
   public boolean writeString(StringJsonWriter writer, Object object, int index) {
     switch (writeKindId) {
+      case KIND_NULL:
+        writer.writeFieldName(this, index);
+        writer.writeNull();
+        return true;
       case KIND_BOOLEAN:
         if (!writeRawType.isPrimitive()) {
           return writeStringScalar(writer, object, index);
@@ -760,6 +842,10 @@ public final class JsonFieldInfo {
 
   public boolean writeUtf8(Utf8JsonWriter writer, Object object, int index) {
     switch (writeKindId) {
+      case KIND_NULL:
+        writer.writeFieldName(this, index);
+        writer.writeNull();
+        return true;
       case KIND_BOOLEAN:
         if (!writeRawType.isPrimitive()) {
           return writeUtf8Scalar(writer, object, index);
@@ -837,7 +923,7 @@ public final class JsonFieldInfo {
   private boolean writeStringObject(StringJsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.stringWriter().writeString(writer, value);
@@ -847,7 +933,7 @@ public final class JsonFieldInfo {
   private boolean writeStringScalar(StringJsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -887,7 +973,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Scalar(Utf8JsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -923,7 +1009,7 @@ public final class JsonFieldInfo {
   private boolean writeStringText(StringJsonWriter writer, Object object, int index) {
     String value = (String) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -937,7 +1023,7 @@ public final class JsonFieldInfo {
   private boolean writeStringRaw(StringJsonWriter writer, Object object, int index) {
     String value = (String) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     if (value == null) {
@@ -951,7 +1037,7 @@ public final class JsonFieldInfo {
   private boolean writeStringEnum(StringJsonWriter writer, Object object, int index) {
     Enum<?> value = (Enum<?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -966,7 +1052,7 @@ public final class JsonFieldInfo {
   private boolean writeStringArray(StringJsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     // Field metadata owns omission only. Once present, the registered codec owns null semantics.
     writer.writeFieldName(this, index);
@@ -977,7 +1063,7 @@ public final class JsonFieldInfo {
   private boolean writeStringCollection(StringJsonWriter writer, Object object, int index) {
     Collection<?> value = (Collection<?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.stringWriter().writeString(writer, value);
@@ -987,7 +1073,7 @@ public final class JsonFieldInfo {
   private boolean writeStringMap(StringJsonWriter writer, Object object, int index) {
     Map<?, ?> value = (Map<?, ?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.stringWriter().writeString(writer, value);
@@ -997,7 +1083,7 @@ public final class JsonFieldInfo {
   private boolean writeStringPojo(StringJsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.stringWriter().writeString(writer, value);
@@ -1077,7 +1163,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Object(Utf8JsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.utf8Writer().writeUtf8(writer, value);
@@ -1087,7 +1173,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8String(Utf8JsonWriter writer, Object object, int index) {
     String value = (String) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -1114,7 +1200,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Raw(Utf8JsonWriter writer, Object object, int index) {
     String value = (String) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     if (value == null) {
@@ -1128,7 +1214,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Enum(Utf8JsonWriter writer, Object object, int index) {
     Enum<?> value = (Enum<?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     if (value == null) {
       writer.writeFieldName(this, index);
@@ -1142,7 +1228,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Array(Utf8JsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     // Field metadata owns omission only. Once present, the registered codec owns null semantics.
     writer.writeFieldName(this, index);
@@ -1153,7 +1239,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Collection(Utf8JsonWriter writer, Object object, int index) {
     Collection<?> value = (Collection<?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.utf8Writer().writeUtf8(writer, value);
@@ -1163,7 +1249,7 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Map(Utf8JsonWriter writer, Object object, int index) {
     Map<?, ?> value = (Map<?, ?>) writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.utf8Writer().writeUtf8(writer, value);
@@ -1173,13 +1259,20 @@ public final class JsonFieldInfo {
   private boolean writeUtf8Pojo(Utf8JsonWriter writer, Object object, int index) {
     Object value = writeAccessor.getObject(object);
     if (value == null && !writeNull()) {
-      return false;
+      return omitNullValue();
     }
     writer.writeFieldName(this, index);
     writeTypeInfo.utf8Writer().writeUtf8(writer, value);
     return true;
   }
 
+  private boolean omitNullValue() {
+    if (requiresNonNullWrite()) {
+      rejectNullWrite();
+    }
+    return false;
+  }
+
   private static JsonFieldKind kind(Class<?> rawType) {
     if (rawType == boolean.class || rawType == Boolean.class) {
       return JsonFieldKind.BOOLEAN;
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/reader/JsonReader.java b/java/fory-json/src/main/java/org/apache/fory/json/reader/JsonReader.java
index ea0bf5a32..8384c6361 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/reader/JsonReader.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/reader/JsonReader.java
@@ -303,6 +303,18 @@ public abstract class JsonReader {
    */
   public abstract String readFieldName();
 
+  /** Consumes {@code expected} after whitespace when present. */
+  public abstract boolean consumeNextToken(char expected);
+
+  /** Consumes {@code expected} after whitespace or fails. */
+  public abstract void expectNextToken(char expected);
+
+  /** Consumes the comma before the next object member, or the closing brace. */
+  public abstract boolean consumeNextCommaOrEndObject();
+
+  /** Consumes the comma before the next array element, or the closing bracket. */
+  public abstract boolean consumeNextCommaOrEndArray();
+
   protected static long fieldNameHash(int length, long word0, long word1) {
     if (length == 0) {
       return JsonFieldNameHash.MAGIC_HASH_CODE;
@@ -326,6 +338,31 @@ public abstract class JsonReader {
     return position;
   }
 
+  /**
+   * Proves that an already selected input span contains at least {@code bytes} readable bytes.
+   *
+   * <p>Every supported input code unit is backed by at least one byte, so the
+   * representation-neutral length is a conservative byte lower bound. Composite codecs use this
+   * before a compact scalar controls a larger variable-capacity allocation.
+   */
+  @Internal
+  public final void checkReadableBytesFrom(int start, int bytes) {
+    int inputLength = length();
+    if (start < 0 || start > position || bytes < 0 || bytes > inputLength - start) {
+      throwInsufficientReadableBytes(start, bytes, inputLength);
+    }
+  }
+
+  private void throwInsufficientReadableBytes(int start, int bytes, int inputLength) {
+    throw new ForyJsonException(
+        "Insufficient JSON input for variable-capacity value: requested "
+            + bytes
+            + " readable bytes from position "
+            + start
+            + ", input length "
+            + inputLength);
+  }
+
   @Internal
   public final String materializeFieldName(int start) {
     int current = position;
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/resolver/CodecRegistry.java b/java/fory-json/src/main/java/org/apache/fory/json/resolver/CodecRegistry.java
index e9088a547..a0b643655 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/resolver/CodecRegistry.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/resolver/CodecRegistry.java
@@ -20,11 +20,16 @@
 package org.apache.fory.json.resolver;
 
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.Comparator;
+import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ConcurrentMap;
+import org.apache.fory.annotation.Internal;
+import org.apache.fory.json.JsonCodecFactory;
 import org.apache.fory.json.codec.JsonValueCodec;
 import org.apache.fory.util.Preconditions;
 
@@ -39,31 +44,77 @@ import org.apache.fory.util.Preconditions;
  */
 public final class CodecRegistry {
   private final ConcurrentMap<Class<?>, JsonValueCodec<?>> codecs;
+  private final ConcurrentMap<Class<?>, FactoryBinding> factories;
 
   public CodecRegistry() {
     codecs = new ConcurrentHashMap<>();
+    factories = new ConcurrentHashMap<>();
   }
 
-  private CodecRegistry(ConcurrentMap<Class<?>, JsonValueCodec<?>> codecs) {
+  private CodecRegistry(
+      ConcurrentMap<Class<?>, JsonValueCodec<?>> codecs,
+      ConcurrentMap<Class<?>, FactoryBinding> factories) {
     this.codecs = codecs;
+    this.factories = factories;
   }
 
   public <T> void register(Class<T> type, JsonValueCodec<T> codec) {
     Preconditions.checkNotNull(type);
     Preconditions.checkNotNull(codec);
     codecs.put(type, codec);
+    factories.remove(type);
+  }
+
+  public <T> void registerFactory(Class<T> type, JsonCodecFactory factory) {
+    Preconditions.checkNotNull(type);
+    Preconditions.checkNotNull(factory);
+    factories.put(type, FactoryBinding.create(type, factory));
+    codecs.remove(type);
   }
 
   public JsonValueCodec<?> get(Class<?> type) {
     return codecs.get(type);
   }
 
+  public FactoryBinding getFactory(Class<?> type) {
+    return factories.get(type);
+  }
+
+  /** Returns a read-only view of the exact factory registrations in this snapshot. */
+  @Internal
+  public Map<Class<?>, FactoryBinding> factoryBindings() {
+    return Collections.unmodifiableMap(factories);
+  }
+
+  public boolean contains(Class<?> type) {
+    return codecs.containsKey(type) || factories.containsKey(type);
+  }
+
+  /** Adds registrations not already owned by this registry. */
+  public void putDefaults(CodecRegistry defaults) {
+    for (Map.Entry<Class<?>, JsonValueCodec<?>> entry : defaults.codecs.entrySet()) {
+      Class<?> type = entry.getKey();
+      if (!contains(type)) {
+        codecs.put(type, entry.getValue());
+      }
+    }
+    for (Map.Entry<Class<?>, FactoryBinding> entry : defaults.factories.entrySet()) {
+      Class<?> type = entry.getKey();
+      if (!contains(type)) {
+        factories.put(type, entry.getValue());
+      }
+    }
+  }
+
   public CodecRegistry copy() {
     ConcurrentMap<Class<?>, JsonValueCodec<?>> copied = new ConcurrentHashMap<>(codecs.size());
     for (Map.Entry<Class<?>, JsonValueCodec<?>> entry : codecs.entrySet()) {
       copied.put(entry.getKey(), entry.getValue());
     }
-    return new CodecRegistry(copied);
+    ConcurrentMap<Class<?>, FactoryBinding> copiedFactories =
+        new ConcurrentHashMap<>(factories.size());
+    copiedFactories.putAll(factories);
+    return new CodecRegistry(copied, copiedFactories);
   }
 
   public String codegenKey() {
@@ -71,12 +122,78 @@ public final class CodecRegistry {
     entries.sort(Comparator.comparing(entry -> entry.getKey().getName()));
     StringBuilder builder = new StringBuilder(entries.size() * 48);
     for (Map.Entry<Class<?>, JsonValueCodec<?>> entry : entries) {
-      builder
-          .append(entry.getKey().getName())
-          .append('=')
-          .append(entry.getValue().getClass().getName())
-          .append(';');
+      appendIdentity(builder, entry.getKey().getName());
+      appendIdentity(builder, entry.getValue().getClass().getName());
+    }
+    List<Map.Entry<Class<?>, FactoryBinding>> factoryEntries =
+        new ArrayList<>(factories.entrySet());
+    factoryEntries.sort(Comparator.comparing(entry -> entry.getKey().getName()));
+    for (Map.Entry<Class<?>, FactoryBinding> entry : factoryEntries) {
+      FactoryBinding binding = entry.getValue();
+      appendIdentity(builder, entry.getKey().getName());
+      appendIdentity(builder, binding.factory.getClass().getName());
+      appendIdentity(builder, binding.key);
+      for (Class<?> runtimeType : binding.handledRuntimeClasses) {
+        appendIdentity(builder, runtimeType.getName());
+      }
     }
     return builder.toString();
   }
+
+  private static void appendIdentity(StringBuilder builder, String value) {
+    builder.append(value.length()).append(':').append(value);
+  }
+
+  /** Immutable build-time snapshot of one exact factory registration. */
+  @Internal
+  public static final class FactoryBinding {
+    private final JsonCodecFactory factory;
+    private final String key;
+    private final List<Class<?>> handledRuntimeClasses;
+
+    private FactoryBinding(
+        JsonCodecFactory factory, String key, List<Class<?>> handledRuntimeClasses) {
+      this.factory = factory;
+      this.key = key;
+      this.handledRuntimeClasses = handledRuntimeClasses;
+    }
+
+    private static FactoryBinding create(Class<?> target, JsonCodecFactory factory) {
+      String key = Preconditions.checkNotNull(factory.factoryKey());
+      if (key.isEmpty()) {
+        throw new IllegalArgumentException("JSON codec factory key must not be empty");
+      }
+      List<Class<?>> declared = Preconditions.checkNotNull(factory.handledRuntimeClasses());
+      ArrayList<Class<?>> handled = new ArrayList<>(declared.size());
+      IdentityHashMap<Class<?>, Boolean> identities = new IdentityHashMap<>();
+      HashSet<String> names = new HashSet<>();
+      for (Class<?> runtimeType : declared) {
+        Preconditions.checkNotNull(runtimeType);
+        if (!target.isAssignableFrom(runtimeType)) {
+          throw new IllegalArgumentException(
+              runtimeType.getName() + " is not a subtype of " + target.getName());
+        }
+        if (identities.put(runtimeType, Boolean.TRUE) != null
+            || !names.add(runtimeType.getName())) {
+          throw new IllegalArgumentException(
+              "Duplicate handled runtime class " + runtimeType.getName());
+        }
+        handled.add(runtimeType);
+      }
+      handled.sort(Comparator.comparing(Class::getName));
+      return new FactoryBinding(factory, key, Collections.unmodifiableList(handled));
+    }
+
+    public JsonCodecFactory factory() {
+      return factory;
+    }
+
+    public String key() {
+      return key;
+    }
+
+    public List<Class<?>> handledRuntimeClasses() {
+      return handledRuntimeClasses;
+    }
+  }
 }
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonSharedRegistry.java b/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonSharedRegistry.java
index 47d7032ca..e2166e8e1 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonSharedRegistry.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonSharedRegistry.java
@@ -98,6 +98,7 @@ import org.apache.fory.codegen.CodeGenerator;
 import org.apache.fory.codegen.GeneratedClassNames;
 import org.apache.fory.exception.InsecureException;
 import org.apache.fory.json.ForyJsonException;
+import org.apache.fory.json.JsonCodecFactory;
 import org.apache.fory.json.JsonConfig;
 import org.apache.fory.json.JsonTypeCheckContext;
 import org.apache.fory.json.JsonTypeChecker;
@@ -124,6 +125,7 @@ import org.apache.fory.json.codegen.JsonJITContext;
 import org.apache.fory.json.meta.JsonAnySetterAccessor;
 import org.apache.fory.json.meta.JsonFieldAccessor;
 import org.apache.fory.json.meta.JsonFieldKind;
+import org.apache.fory.json.resolver.CodecRegistry.FactoryBinding;
 import org.apache.fory.json.resolver.JsonGeneratedClassRegistry.Configuration;
 import org.apache.fory.platform.AndroidSupport;
 import org.apache.fory.platform.GraalvmSupport;
@@ -167,6 +169,9 @@ public final class JsonSharedRegistry {
       };
 
   private final CodecRegistry customCodecs;
+  private final JsonCodecFactory[] codecFactories;
+  private final String[] codecFactoryIdentities;
+  private final IdentityHashMap<Class<?>, ExactFactoryBinding> runtimeFactories;
   private final IdentityHashMap<Class<?>, JsonValueCodec<?>> exactCodecs;
   private final JsonTypeChecker typeChecker;
   private final JsonTypeCheckContext typeCheckContext;
@@ -215,6 +220,21 @@ public final class JsonSharedRegistry {
   private JsonSharedRegistry(
       JsonConfig config, ExecutorService compilationService, boolean hostedCodegen) {
     this.customCodecs = config.codecRegistry();
+    codecFactories = config.codecFactories();
+    codecFactoryIdentities = config.codecFactoryIdentities();
+    runtimeFactories = new IdentityHashMap<>();
+    for (Map.Entry<Class<?>, FactoryBinding> entry : customCodecs.factoryBindings().entrySet()) {
+      Class<?> target = entry.getKey();
+      FactoryBinding binding = entry.getValue();
+      for (Class<?> runtimeType : binding.handledRuntimeClasses()) {
+        ExactFactoryBinding previous =
+            runtimeFactories.put(runtimeType, new ExactFactoryBinding(target, binding));
+        if (previous != null && previous.binding != binding) {
+          throw new IllegalArgumentException(
+              "Conflicting JSON runtime codec factories for " + runtimeType.getName());
+        }
+      }
+    }
     // Hosted compilation produces classes shared by configurations with the same source shape.
     // Runtime type policy is intentionally not part of that shape and remains enforced by each
     // runtime resolver before it installs a generated capability.
@@ -537,7 +557,9 @@ public final class JsonSharedRegistry {
   }
 
   GeneratedJsonCodec<?> generatedCodec(Class<?> type) {
-    if (GraalvmSupport.IN_GRAALVM_NATIVE_IMAGE) {
+    // Hosted analysis generates the codec selected by the active configuration. Requiring an
+    // annotation-processor companion here would exclude models owned by language modules.
+    if (hostedCodegen || GraalvmSupport.IN_GRAALVM_NATIVE_IMAGE) {
       return null;
     }
     Class<?> mixinType = mixinType(type);
@@ -945,6 +967,10 @@ public final class JsonSharedRegistry {
     if (customCodec != null) {
       return customCodec;
     }
+    FactoryBinding exactFactory = customCodecs.getFactory(rawType);
+    if (exactFactory != null) {
+      return createExactCodec(rawType, typeRef, exactFactory, localResolver);
+    }
     JsonValueCodec<?> codec = exactCodecs.get(rawType);
     if (codec != null) {
       return codec;
@@ -960,9 +986,6 @@ public final class JsonSharedRegistry {
     if (URL.class.isAssignableFrom(rawType)) {
       throw new ForyJsonException("Unsupported JSON type " + rawType);
     }
-    if (Number.class.isAssignableFrom(rawType) || CharSequence.class.isAssignableFrom(rawType)) {
-      throw new ForyJsonException("Unsupported JSON type " + rawType);
-    }
     if (rawType.isEnum()) {
       return new ScalarCodecs.EnumCodec(rawType);
     }
@@ -999,6 +1022,13 @@ public final class JsonSharedRegistry {
     if (Path.class.isAssignableFrom(rawType)) {
       return ScalarCodecs.PathCodec.INSTANCE;
     }
+    codec = createModuleCodec(typeRef, localResolver);
+    if (codec != null) {
+      return codec;
+    }
+    if (Number.class.isAssignableFrom(rawType) || CharSequence.class.isAssignableFrom(rawType)) {
+      throw new ForyJsonException("Unsupported JSON type " + rawType);
+    }
     if (Collection.class.isAssignableFrom(rawType)) {
       return CollectionCodec.create(rawType, typeRef, localResolver);
     }
@@ -1008,10 +1038,86 @@ public final class JsonSharedRegistry {
     return null;
   }
 
+  private JsonValueCodec<?> createExactCodec(
+      Class<?> target, TypeRef<?> typeRef, FactoryBinding binding, JsonTypeResolver localResolver) {
+    JsonValueCodec<?> codec;
+    try {
+      codec = binding.factory().create(typeRef, localResolver);
+    } catch (UnsupportedJsonTypeException e) {
+      throw new ForyJsonException("Exact JSON codec factory rejected " + target.getTypeName(), e);
+    }
+    if (codec == null) {
+      throw new ForyJsonException(
+          "Exact JSON codec factory returned null for " + target.getTypeName());
+    }
+    return codec;
+  }
+
+  Class<?> runtimeCodecTarget(Class<?> runtimeType) {
+    ExactFactoryBinding binding = runtimeFactories.get(runtimeType);
+    if (binding == null) {
+      return null;
+    }
+    checkSecure(binding.target);
+    return binding.target;
+  }
+
+  private JsonValueCodec<?> createModuleCodec(TypeRef<?> typeRef, JsonTypeResolver localResolver) {
+    JsonValueCodec<?> selected = null;
+    UnsupportedJsonTypeException unsupported = null;
+    ArrayList<String> claims = null;
+    for (int i = 0; i < codecFactories.length; i++) {
+      JsonValueCodec<?> codec = null;
+      UnsupportedJsonTypeException rejected = null;
+      try {
+        codec = codecFactories[i].create(typeRef, localResolver);
+      } catch (UnsupportedJsonTypeException e) {
+        rejected = e;
+      }
+      if (codec == null && rejected == null) {
+        continue;
+      }
+      if (claims == null) {
+        claims = new ArrayList<>(2);
+      }
+      claims.add(codecFactoryIdentities[i]);
+      if (codec != null && selected == null) {
+        selected = codec;
+      }
+      if (rejected != null && unsupported == null) {
+        unsupported = rejected;
+      }
+    }
+    if (claims == null) {
+      return null;
+    }
+    if (claims.size() == 1) {
+      if (selected != null) {
+        return selected;
+      }
+      throw unsupported;
+    }
+    claims.sort(String::compareTo);
+    throw new ForyJsonException(
+        "Conflicting JSON codec factories for " + typeRef.getType() + ": " + claims);
+  }
+
+  private static final class ExactFactoryBinding {
+    private final Class<?> target;
+    private final FactoryBinding binding;
+
+    private ExactFactoryBinding(Class<?> target, FactoryBinding binding) {
+      this.target = target;
+      this.binding = binding;
+    }
+  }
+
   public JsonFieldKind kind(Class<?> type) {
     // A registered codec owns the full representation. Resolve that choice before object metadata
     // and codegen specialize fields so generated and interpreted paths cannot bypass the codec.
-    if (customCodecs.get(type) != null) {
+    if (customCodecs.get(type) != null
+        || customCodecs.getFactory(type) != null
+        || runtimeFactories.containsKey(type)) {
       return JsonFieldKind.OBJECT;
     }
     if (type == boolean.class || type == Boolean.class) {
diff --git a/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonTypeResolver.java b/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonTypeResolver.java
index 9f7d0d021..a87107ab0 100644
--- a/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonTypeResolver.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/resolver/JsonTypeResolver.java
@@ -19,7 +19,9 @@
 
 package org.apache.fory.json.resolver;
 
+import java.lang.reflect.Constructor;
 import java.lang.reflect.GenericArrayType;
+import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
 import java.lang.reflect.ParameterizedType;
 import java.lang.reflect.Type;
@@ -29,6 +31,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.IdentityHashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Optional;
@@ -46,7 +49,9 @@ import org.apache.fory.json.codec.ArrayCodec;
 import org.apache.fory.json.codec.ClosedSubtypeCodec;
 import org.apache.fory.json.codec.CodecUtils;
 import org.apache.fory.json.codec.CollectionCodec;
+import org.apache.fory.json.codec.CompositeJsonCodec;
 import org.apache.fory.json.codec.GeneratedJsonCodec;
+import org.apache.fory.json.codec.JsonObjectModel;
 import org.apache.fory.json.codec.JsonSubTypesInfo;
 import org.apache.fory.json.codec.JsonUnwrappedInfo;
 import org.apache.fory.json.codec.JsonValueCodec;
@@ -98,27 +103,30 @@ public final class JsonTypeResolver {
 
   private final Map<Object, ObjectCodec<?>> objectCodecs;
   private final Map<Object, JsonTypeInfo> typeInfos;
+  private final IdentityHashMap<Class<?>, JsonTypeInfo> runtimeTypeInfos;
   private final JsonSharedRegistry sharedRegistry;
   private final JsonCodegen codegen;
   private final JsonJITContext jitContext;
   private final IdentityMap<Class<?>, JsonTypeInfo> rawObjectTypeInfos;
   private final IdentityMap<ObjectCodec<?>, JsonTypeInfo> canonicalObjectTypeInfos;
   private final IdentityMap<JsonTypeInfo, CollectionCodec<?>> collectionCodecs;
+  private final IdentityMap<JsonTypeInfo, Class<?>> subtypeTypeRoots;
   private int resolutionDepth;
-
-  private enum RuntimeObjectKey {
-    INSTANCE
-  }
+  private Class<?> runtimeResolutionType;
+  private Class<?> subtypeResolutionBase;
+  private boolean isolateSubtypeResolution;
 
   public JsonTypeResolver(JsonSharedRegistry sharedRegistry) {
     this.sharedRegistry = sharedRegistry;
     objectCodecs = new HashMap<>();
     typeInfos = new HashMap<>();
+    runtimeTypeInfos = new IdentityHashMap<>();
     codegen = sharedRegistry.codegen();
     jitContext = sharedRegistry.newJITContext();
     rawObjectTypeInfos = new IdentityMap<>();
     canonicalObjectTypeInfos = new IdentityMap<>();
     collectionCodecs = new IdentityMap<>();
+    subtypeTypeRoots = new IdentityMap<>();
   }
 
   /** Returns the shared registry that owns this resolver and its reader cache domain. */
@@ -144,7 +152,7 @@ public final class JsonTypeResolver {
   @SuppressWarnings("unchecked")
   private <T> ObjectCodec<T> getObjectCodec(TypeRef<T> ownerType) {
     Class<?> rawType = ownerType.getRawType();
-    Object key = typeInfoKey(ownerType.getType(), rawType);
+    Object key = resolutionTypeKey(ownerType.getType(), rawType);
     return getObjectCodec(ownerType, key);
   }
 
@@ -170,7 +178,7 @@ public final class JsonTypeResolver {
   @Internal
   public ObjectCodec<?> getUnwrappedObjectCodec(Class<?> rawType) {
     TypeRef<?> ownerType = TypeRef.of(rawType);
-    Object key = typeInfoKey(rawType, rawType);
+    Object key = resolutionTypeKey(rawType, rawType);
     JsonTypeInfo typeInfo = typeInfos.get(key);
     if (typeInfo != null) {
       // Generated capabilities replace type-info slots; objectCodecs retains the stable metadata
@@ -182,7 +190,18 @@ public final class JsonTypeResolver {
     }
     JsonValueCodec<?> selected = sharedRegistry.createCodec(rawType, ownerType, this);
     if (selected != null) {
-      return null;
+      if (!(selected instanceof ObjectCodec)) {
+        return null;
+      }
+      // A language object model still produces the standard ObjectCodec; only its constructor and
+      // accessors differ. Publish that shell without resolving it so JsonUnwrappedInfo remains the
+      // sole owner of iterative flattened-graph resolution and cycle detection.
+      ObjectCodec<?> codec = (ObjectCodec<?>) selected;
+      objectCodecs.put(key, codec);
+      typeInfo = newTypeInfo(rawType, rawType, codec);
+      publishTypeInfo(key, typeInfo);
+      registerTypeInfoOwner(typeInfo, codec);
+      return codec;
     }
     ObjectCodec<?> codec = objectCodecs.get(key);
     if (codec == null) {
@@ -190,7 +209,7 @@ public final class JsonTypeResolver {
       objectCodecs.put(key, codec);
     }
     typeInfo = newTypeInfo(rawType, rawType, codec);
-    typeInfos.put(key, typeInfo);
+    publishTypeInfo(key, typeInfo);
     registerTypeInfoOwner(typeInfo, codec);
     return codec;
   }
@@ -216,7 +235,7 @@ public final class JsonTypeResolver {
     if (rawObjectTypeInfos.get(typeInfo.rawType()) != typeInfo) {
       return null;
     }
-    return objectCodecs.get(typeInfo.rawType());
+    return objectCodecs.get(metadataKey(typeInfo));
   }
 
   /** Returns an exact declared ArrayList-backed UTF-8 collection owner, or {@code null}. */
@@ -291,13 +310,24 @@ public final class JsonTypeResolver {
   private JsonTypeInfo declaredCollectionElement(JsonTypeInfo collection) {
     Type elementType = CodecUtils.elementType(collection.type());
     Class<?> rawType = CodecUtils.rawType(elementType, Object.class);
-    return typeInfos.get(typeInfoKey(elementType, rawType));
+    Class<?> subtypeRoot = subtypeTypeRoots.get(collection);
+    Object key =
+        subtypeRoot == null
+            ? typeInfoKey(elementType, rawType)
+            : subtypeTypeKey(subtypeRoot, elementType, rawType);
+    return typeInfos.get(key);
   }
 
   public JsonTypeInfo getTypeInfo(Type declaredType, Class<?> fallback) {
     Class<?> rawType = CodecUtils.rawType(declaredType, fallback);
-    Object key = typeInfoKey(declaredType, rawType);
+    Object key = resolutionTypeKey(declaredType, rawType);
     JsonTypeInfo typeInfo = typeInfos.get(key);
+    if (typeInfo == null && declaredType == rawType && runtimeResolutionType == rawType) {
+      // A dynamic root stays write-only, but its composite shell must still be visible to its own
+      // child binding. Do not publish that shell in typeInfos: a later declared read must resolve
+      // and validate an independent declared-type codec.
+      typeInfo = runtimeTypeInfos.get(rawType);
+    }
     if (typeInfo != null) {
       return typeInfo;
     }
@@ -374,7 +404,7 @@ public final class JsonTypeResolver {
   private JsonTypeInfo resolveTypeInfo(Type declaredType, Class<?> rawType, Object key) {
     JsonTypeInfo typeInfo = customTypeInfo(declaredType, rawType);
     if (typeInfo != null) {
-      typeInfos.put(key, typeInfo);
+      publishTypeInfo(key, typeInfo);
       return typeInfo;
     }
     JsonSubTypesInfo definition = sharedRegistry.subTypesInfo(rawType);
@@ -385,8 +415,8 @@ public final class JsonTypeResolver {
       // Closed graphs may recursively refer to their declared base through a subtype field or
       // container. Publish the complete dispatcher shell before resolving every finite branch.
       // The outer cold-resolution transaction removes the complete provisional graph on failure.
-      typeInfos.put(key, typeInfo);
-      codec.resolve(this);
+      publishTypeInfo(key, typeInfo);
+      codec.resolveTypes(TypeRef.of(declaredType), this);
       return typeInfo;
     }
     return buildTypeInfo(rawType, declaredType, key);
@@ -488,6 +518,12 @@ public final class JsonTypeResolver {
               : new ScalarCodecs.AtomicReferenceCodec(contentInfo);
       return newTypeInfo(declaredType, rawType, codec);
     }
+    JsonValueCodec<?> codec = sharedRegistry.createCodec(rawType, typeRef, this);
+    if (codec instanceof CompositeJsonCodec) {
+      JsonTypeInfo typeInfo = newTypeInfo(declaredType, rawType, JsonFieldKind.OBJECT, codec, true);
+      ((CompositeJsonCodec<?>) codec).resolveTypes(typeRef, this, annotation);
+      return typeInfo;
+    }
     throw invalidCodecConfig(rawType, "does not support child codecs");
   }
 
@@ -659,7 +695,11 @@ public final class JsonTypeResolver {
     ResolutionSnapshot snapshot =
         resolutionDepth == 0
             ? new ResolutionSnapshot(
-                new HashSet<>(typeInfos.keySet()), new HashSet<>(objectCodecs.keySet()))
+                new HashSet<>(typeInfos.keySet()),
+                new HashSet<>(objectCodecs.keySet()),
+                new HashSet<>(runtimeTypeInfos.keySet()),
+                copyIdentityMap(rawObjectTypeInfos),
+                copyIdentityMap(canonicalObjectTypeInfos))
             : null;
     resolutionDepth++;
     return snapshot;
@@ -712,14 +752,8 @@ public final class JsonTypeResolver {
       Map.Entry<Object, JsonTypeInfo> entry = typeIterator.next();
       if (!snapshot.typeKeys.contains(entry.getKey())) {
         JsonTypeInfo value = entry.getValue();
-        if (rawObjectTypeInfos.get(value.rawType()) == value) {
-          rawObjectTypeInfos.remove(value.rawType());
-          ObjectCodec<?> owner = objectCodecs.get(value.rawType());
-          if (owner != null) {
-            canonicalObjectTypeInfos.remove(owner);
-          }
-        }
         collectionCodecs.remove(value);
+        subtypeTypeRoots.remove(value);
         typeIterator.remove();
       }
     }
@@ -729,27 +763,61 @@ public final class JsonTypeResolver {
         objectIterator.remove();
       }
     }
+    Iterator<Class<?>> runtimeIterator = runtimeTypeInfos.keySet().iterator();
+    while (runtimeIterator.hasNext()) {
+      if (!snapshot.runtimeKeys.contains(runtimeIterator.next())) {
+        runtimeIterator.remove();
+      }
+    }
+    restoreIdentityMap(rawObjectTypeInfos, snapshot.rawObjectTypeInfos);
+    restoreIdentityMap(canonicalObjectTypeInfos, snapshot.canonicalObjectTypeInfos);
   }
 
   private static final class ResolutionSnapshot {
     private final Set<Object> typeKeys;
     private final Set<Object> objectKeys;
-
-    private ResolutionSnapshot(Set<Object> typeKeys, Set<Object> objectKeys) {
+    private final Set<Class<?>> runtimeKeys;
+    private final IdentityHashMap<Class<?>, JsonTypeInfo> rawObjectTypeInfos;
+    private final IdentityHashMap<ObjectCodec<?>, JsonTypeInfo> canonicalObjectTypeInfos;
+
+    private ResolutionSnapshot(
+        Set<Object> typeKeys,
+        Set<Object> objectKeys,
+        Set<Class<?>> runtimeKeys,
+        IdentityHashMap<Class<?>, JsonTypeInfo> rawObjectTypeInfos,
+        IdentityHashMap<ObjectCodec<?>, JsonTypeInfo> canonicalObjectTypeInfos) {
       this.typeKeys = typeKeys;
       this.objectKeys = objectKeys;
+      this.runtimeKeys = runtimeKeys;
+      this.rawObjectTypeInfos = rawObjectTypeInfos;
+      this.canonicalObjectTypeInfos = canonicalObjectTypeInfos;
+    }
+  }
+
+  private static <K, V> IdentityHashMap<K, V> copyIdentityMap(IdentityMap<K, V> source) {
+    IdentityHashMap<K, V> copy = new IdentityHashMap<>(source.size);
+    for (Map.Entry<K, V> entry : source.iterable()) {
+      copy.put(entry.getKey(), entry.getValue());
+    }
+    return copy;
+  }
+
+  private static <K, V> void restoreIdentityMap(
+      IdentityMap<K, V> target, IdentityHashMap<K, V> snapshot) {
+    target.clear();
+    for (Map.Entry<K, V> entry : snapshot.entrySet()) {
+      target.put(entry.getKey(), entry.getValue());
     }
   }
 
   public JsonTypeInfo getRuntimeTypeInfo(Class<?> runtimeType) {
-    Object key = runtimeType == Object.class ? RuntimeObjectKey.INSTANCE : runtimeType;
-    JsonTypeInfo typeInfo = typeInfos.get(key);
+    JsonTypeInfo typeInfo = runtimeTypeInfos.get(runtimeType);
     if (typeInfo != null) {
       return typeInfo;
     }
     ResolutionSnapshot snapshot = beginResolution();
     try {
-      JsonTypeInfo result = resolveRuntimeTypeInfo(runtimeType, key);
+      JsonTypeInfo result = resolveRuntimeTypeInfo(runtimeType);
       completeResolution(snapshot);
       return result;
     } catch (RuntimeException | Error e) {
@@ -760,41 +828,246 @@ public final class JsonTypeResolver {
     }
   }
 
-  private JsonTypeInfo resolveRuntimeTypeInfo(Class<?> runtimeType, Object key) {
+  private JsonTypeInfo resolveRuntimeTypeInfo(Class<?> runtimeType) {
+    Class<?> previousRuntimeType = runtimeResolutionType;
+    runtimeResolutionType = runtimeType;
+    try {
+      return resolveRuntimeTypeInfo0(runtimeType);
+    } finally {
+      runtimeResolutionType = previousRuntimeType;
+    }
+  }
+
+  private JsonTypeInfo resolveRuntimeTypeInfo0(Class<?> runtimeType) {
     JsonTypeInfo typeInfo = customTypeInfo(runtimeType, runtimeType);
-    JsonValueCodec<?> codec = null;
-    if (typeInfo == null) {
-      sharedRegistry.checkSecure(runtimeType);
+    if (typeInfo != null) {
+      runtimeTypeInfos.put(runtimeType, typeInfo);
+      return typeInfo;
+    }
+    sharedRegistry.checkSecure(runtimeType);
+    Class<?> aliasTarget = sharedRegistry.runtimeCodecTarget(runtimeType);
+    if (aliasTarget != null) {
+      typeInfo = getTypeInfo(aliasTarget, aliasTarget);
+      runtimeTypeInfos.put(runtimeType, typeInfo);
+      return typeInfo;
+    }
+    if (runtimeType == Object.class) {
+      // Declared Object uses the natural JSON codec, but an actual Object instance has the
+      // structural empty-object representation. Keep those two owners separate so natural
+      // runtime dispatch cannot resolve back to itself.
       TypeRef<?> typeRef = TypeRef.of(runtimeType);
-      codec =
-          runtimeType == Object.class
-              ? getObjectCodec(typeRef)
-              : sharedRegistry.createCodec(runtimeType, typeRef, this);
-      if (codec == null) {
-        codec = getObjectCodec(typeRef);
-      }
+      JsonValueCodec<?> codec = getObjectCodec(typeRef);
       typeInfo = newTypeInfo(runtimeType, runtimeType, codec);
+      registerTypeInfoOwner(typeInfo, codec);
+      runtimeTypeInfos.put(runtimeType, typeInfo);
+      return typeInfo;
     }
-    JsonTypeInfo recursiveTypeInfo = typeInfos.get(key);
-    if (recursiveTypeInfo != null) {
-      return recursiveTypeInfo;
+    typeInfo = typeInfos.get(runtimeType);
+    if (typeInfo != null) {
+      runtimeTypeInfos.put(runtimeType, typeInfo);
+      return typeInfo;
     }
-    typeInfos.put(key, typeInfo);
-    if (codec != null) {
+    TypeRef<?> typeRef = TypeRef.of(runtimeType);
+    JsonValueCodec<?> codec = sharedRegistry.createCodec(runtimeType, typeRef, this);
+    if (codec == null) {
+      codec = getObjectCodec(typeRef);
+    }
+    if (codec instanceof ClosedSubtypeCodec) {
+      Class<?> baseType = ((ClosedSubtypeCodec) codec).baseType();
+      if (baseType != runtimeType) {
+        if (!baseType.isAssignableFrom(runtimeType)) {
+          throw new ForyJsonException(
+              "Closed JSON root " + baseType.getName() + " does not own " + runtimeType.getName());
+        }
+        // A module may recognize a runtime branch by returning its closed root codec. Resolve the
+        // declared root before publishing the runtime alias so child binding cannot observe that
+        // root shell as the branch's own recursive metadata.
+        typeInfo = getTypeInfo(baseType, baseType);
+        runtimeTypeInfos.put(runtimeType, typeInfo);
+        return typeInfo;
+      }
+    }
+    typeInfo = typeInfos.get(runtimeType);
+    if (typeInfo == null) {
+      typeInfo = newTypeInfo(runtimeType, runtimeType, codec);
+      if (codec instanceof ObjectCodec) {
+        objectCodecs.put(runtimeType, (ObjectCodec<?>) codec);
+        publishTypeInfo(runtimeType, typeInfo);
+      } else {
+        // Composite runtime codecs need the same publish-before-bind lifecycle as ObjectCodec,
+        // without turning a dynamic write binding into a declared read schema.
+        runtimeTypeInfos.put(runtimeType, typeInfo);
+      }
       registerTypeInfoOwner(typeInfo, codec);
+      resolveCodecTypes(codec, typeRef);
     }
+    runtimeTypeInfos.put(runtimeType, typeInfo);
     return typeInfo;
   }
 
+  /** Returns whether the current cold lookup was initiated for a dynamic runtime write type. */
+  @Internal
+  public boolean resolvingRuntimeType() {
+    return runtimeResolutionType != null;
+  }
+
+  /** Resolves one branch while preserving the closed root that owns its discriminator schema. */
+  @Internal
+  public JsonTypeInfo getSubtypeTypeInfo(
+      Class<?> baseType, Type declaredType, Class<?> fallback, boolean isolated) {
+    Class<?> previousBase = subtypeResolutionBase;
+    boolean previousIsolation = isolateSubtypeResolution;
+    subtypeResolutionBase = baseType;
+    isolateSubtypeResolution = isolated;
+    try {
+      return getTypeInfo(declaredType, fallback);
+    } finally {
+      subtypeResolutionBase = previousBase;
+      isolateSubtypeResolution = previousIsolation;
+    }
+  }
+
+  /** Returns whether the current cold lookup is resolving a branch of {@code baseType}. */
+  @Internal
+  public boolean resolvingSubtypeOf(Class<?> baseType) {
+    return subtypeResolutionBase == baseType;
+  }
+
   public void checkSecure(Class<?> type) {
     sharedRegistry.checkSecure(type);
   }
 
+  /** Builds an unresolved object codec from language-module construction metadata. */
+  @Internal
+  public ObjectCodec<?> createObjectCodec(TypeRef<?> ownerType, JsonObjectModel objectModel) {
+    Class<?> type = ownerType.getRawType();
+    sharedRegistry.checkSecure(type);
+    validateObjectModel(type, objectModel);
+    return ObjectCodec.build(
+        ownerType,
+        sharedRegistry.propertyDiscoveryEnabled(),
+        sharedRegistry.propertyNamingStrategy(),
+        sharedRegistry.writeNullFields(),
+        sharedRegistry,
+        sharedRegistry.generatedCodec(type),
+        objectModel);
+  }
+
+  private static void validateObjectModel(Class<?> type, JsonObjectModel objectModel) {
+    Constructor<?> constructor = objectModel.constructor();
+    int modifiers = constructor.getModifiers();
+    if (constructor.getDeclaringClass() != type
+        || !Modifier.isPublic(modifiers)
+        || constructor.isSynthetic()
+        || constructor.isVarArgs()
+        || constructor.getTypeParameters().length != 0) {
+      throw new ForyJsonException("Invalid JSON object-model constructor " + constructor);
+    }
+    Class<?>[] parameterTypes = constructor.getParameterTypes();
+    String[] names = objectModel.parameterNames();
+    Method[] accessors = objectModel.accessors();
+    for (int i = 0; i < accessors.length; i++) {
+      Method accessor = accessors[i];
+      if (accessor == null) {
+        continue;
+      }
+      int accessorModifiers = accessor.getModifiers();
+      boolean unitAccessor =
+          accessor.getReturnType() == void.class
+              && parameterTypes[i].getName().equals("scala.runtime.BoxedUnit");
+      if (!accessor.getName().equals(names[i])
+          || accessor.getParameterCount() != 0
+          || accessor.getReturnType() != parameterTypes[i] && !unitAccessor
+          || !Modifier.isPublic(accessorModifiers)
+          || Modifier.isStatic(accessorModifiers)
+          || accessor.isBridge()
+          || accessor.isSynthetic()
+          || !accessor.getDeclaringClass().isAssignableFrom(type)) {
+        throw new ForyJsonException("Invalid JSON object-model accessor " + accessor);
+      }
+    }
+    String[] propertyNames = objectModel.propertyNames();
+    Method[] getters = objectModel.propertyGetters();
+    Method[] setters = objectModel.propertySetters();
+    for (int i = 0; i < propertyNames.length; i++) {
+      Method getter = getters[i];
+      Method setter = setters[i];
+      if (getter == null && setter == null) {
+        throw new ForyJsonException(
+            "JSON object-model property has no accessor " + propertyNames[i]);
+      }
+      Class<?> propertyType =
+          getter == null ? setter.getParameterTypes()[0] : getter.getReturnType();
+      boolean unitGetter =
+          getter != null
+              && getter.getReturnType() == void.class
+              && parameterType(propertyNames[i], names, parameterTypes) != null
+              && parameterType(propertyNames[i], names, parameterTypes)
+                  .getName()
+                  .equals("scala.runtime.BoxedUnit");
+      if (getter != null
+          && (!getter.getName().equals(propertyNames[i])
+              || getter.getParameterCount() != 0
+              || getter.getReturnType() == void.class && !unitGetter
+              || !validObjectModelMethod(type, getter))) {
+        throw new ForyJsonException("Invalid JSON object-model getter " + getter);
+      }
+      if (setter != null
+          && (setter.getParameterCount() != 1
+              || setter.getParameterTypes()[0] != propertyType
+              || setter.getReturnType() != void.class
+              || !validObjectModelMethod(type, setter))) {
+        throw new ForyJsonException("Invalid JSON object-model setter " + setter);
+      }
+    }
+  }
+
+  private static Class<?> parameterType(
+      String propertyName, String[] names, Class<?>[] parameterTypes) {
+    for (int i = 0; i < names.length; i++) {
+      if (propertyName.equals(names[i])) {
+        return parameterTypes[i];
+      }
+    }
+    return null;
+  }
+
+  private static boolean validObjectModelMethod(Class<?> type, Method method) {
+    int modifiers = method.getModifiers();
+    return Modifier.isPublic(modifiers)
+        && !Modifier.isStatic(modifiers)
+        && !method.isBridge()
+        && !method.isSynthetic()
+        && method.getDeclaringClass().isAssignableFrom(type);
+  }
+
   @Internal
   public void checkMapKeySecure(Class<?> type) {
     sharedRegistry.checkMapKeySecure(type);
   }
 
+  /** Returns the built-in object-member codec for one approved map key type. */
+  @Internal
+  public MapKeyCodec getMapKeyCodec(Class<?> type) {
+    checkMapKeySecure(type);
+    return MapCodec.keyCodec(type);
+  }
+
+  /** Returns one annotation-selected object-member codec for an approved map key type. */
+  @Internal
+  public MapKeyCodec getMapKeyCodec(Class<?> type, Class<? extends MapKeyCodec> codecClass) {
+    checkMapKeySecure(type);
+    return sharedRegistry.mapKeyCodec(type, codecClass);
+  }
+
+  /** Creates uncached type metadata for one parent-owned leaf codec. */
+  @Internal
+  public JsonTypeInfo createLeafTypeInfo(TypeRef<?> type, JsonValueCodec<?> codec) {
+    Class<?> rawType = type.getRawType();
+    sharedRegistry.checkSecure(rawType);
+    return newTypeInfo(type.getType(), rawType, JsonFieldKind.OBJECT, codec, false);
+  }
+
   @SuppressWarnings("unchecked")
   public <T> StringWriterCodec<T> stringWriter(ObjectCodec<T> codec) {
     requireJITLock();
@@ -2079,7 +2352,7 @@ public final class JsonTypeResolver {
         return canonicalObjectOwner(typeInfo) == objectOwner;
       }
       return collectionCodecs.get(typeInfo) == collectionOwner
-          && typeInfos.get(typeInfoKey(typeInfo.type(), typeInfo.rawType())) == typeInfo;
+          && typeInfos.get(metadataKey(typeInfo)) == typeInfo;
     }
 
     private Object current(CapabilityKind kind) {
@@ -2145,11 +2418,21 @@ public final class JsonTypeResolver {
       return recursiveTypeInfo;
     }
     JsonTypeInfo typeInfo = newTypeInfo(declaredType, rawType, codec);
-    typeInfos.put(key, typeInfo);
+    if (codec instanceof ObjectCodec) {
+      objectCodecs.put(key, (ObjectCodec<?>) codec);
+    }
+    publishTypeInfo(key, typeInfo);
     registerTypeInfoOwner(typeInfo, codec);
+    resolveCodecTypes(codec, typeRef);
     return typeInfo;
   }
 
+  private void resolveCodecTypes(JsonValueCodec<?> codec, TypeRef<?> type) {
+    if (codec instanceof CompositeJsonCodec) {
+      ((CompositeJsonCodec<?>) codec).resolveTypes(type, this);
+    }
+  }
+
   private JsonTypeInfo buildObjectTypeInfo(TypeRef<?> ownerType, Object key) {
     JsonTypeInfo typeInfo = typeInfos.get(key);
     if (typeInfo != null) {
@@ -2163,7 +2446,7 @@ public final class JsonTypeResolver {
       // must be visible before any field resolves so self-references reuse the same field table and
       // capability slots. The outer cold-resolution transaction removes both on failure.
       objectCodecs.put(key, codec);
-      typeInfos.put(key, typeInfo);
+      publishTypeInfo(key, typeInfo);
       registerTypeInfoOwner(typeInfo, codec);
       codec.resolveTypes(this);
       return typeInfo;
@@ -2171,7 +2454,7 @@ public final class JsonTypeResolver {
     // A public getObjectCodec call may already own construction of this shell. Bind its type info
     // now; the outer owner finishes field resolution before returning the codec to its caller.
     typeInfo = newTypeInfo(ownerType.getType(), ownerType.getRawType(), codec);
-    typeInfos.put(key, typeInfo);
+    publishTypeInfo(key, typeInfo);
     registerTypeInfoOwner(typeInfo, codec);
     return typeInfo;
   }
@@ -2202,10 +2485,98 @@ public final class JsonTypeResolver {
     }
   }
 
+  private void publishTypeInfo(Object key, JsonTypeInfo typeInfo) {
+    typeInfos.put(key, typeInfo);
+    if (key instanceof SubtypeTypeKey) {
+      subtypeTypeRoots.put(typeInfo, ((SubtypeTypeKey) key).baseType);
+    }
+  }
+
+  private Object metadataKey(JsonTypeInfo typeInfo) {
+    Class<?> subtypeRoot = subtypeTypeRoots.get(typeInfo);
+    Object key = typeInfoKey(typeInfo.type(), typeInfo.rawType());
+    return subtypeRoot == null ? key : new SubtypeTypeKey(subtypeRoot, key);
+  }
+
+  private Object resolutionTypeKey(Type declaredType, Class<?> rawType) {
+    if (!isolateSubtypeResolution || subtypeResolutionBase == null) {
+      return typeInfoKey(declaredType, rawType);
+    }
+    // An exact closed-sum factory owns its branch metadata. Scope every type containing a branch
+    // to that root so recursive binding can reuse it without making the branch a declared schema.
+    return subtypeTypeKey(subtypeResolutionBase, declaredType, rawType);
+  }
+
+  private static Object subtypeTypeKey(Class<?> baseType, Type declaredType, Class<?> rawType) {
+    Object key = typeInfoKey(declaredType, rawType);
+    return referencesSubtype(baseType, declaredType, rawType)
+        ? new SubtypeTypeKey(baseType, key)
+        : key;
+  }
+
+  private static boolean referencesSubtype(Class<?> baseType, Type declaredType, Class<?> rawType) {
+    if (rawType != baseType && baseType.isAssignableFrom(rawType)) {
+      return true;
+    }
+    if (declaredType instanceof ParameterizedType) {
+      Type[] arguments = ((ParameterizedType) declaredType).getActualTypeArguments();
+      for (Type argument : arguments) {
+        Class<?> argumentType = CodecUtils.rawType(argument, Object.class);
+        if (referencesSubtype(baseType, argument, argumentType)) {
+          return true;
+        }
+      }
+    } else if (declaredType instanceof GenericArrayType) {
+      Type elementType = ((GenericArrayType) declaredType).getGenericComponentType();
+      return referencesSubtype(
+          baseType, elementType, CodecUtils.rawType(elementType, Object.class));
+    } else if (declaredType instanceof WildcardType) {
+      WildcardType wildcard = (WildcardType) declaredType;
+      for (Type bound : wildcard.getUpperBounds()) {
+        if (referencesSubtype(baseType, bound, CodecUtils.rawType(bound, Object.class))) {
+          return true;
+        }
+      }
+      for (Type bound : wildcard.getLowerBounds()) {
+        if (referencesSubtype(baseType, bound, CodecUtils.rawType(bound, Object.class))) {
+          return true;
+        }
+      }
+    }
+    return false;
+  }
+
   private static Object typeInfoKey(Type declaredType, Class<?> rawType) {
     return declaredType instanceof Class ? rawType : declaredType;
   }
 
+  private static final class SubtypeTypeKey {
+    private final Class<?> baseType;
+    private final Object typeKey;
+
+    private SubtypeTypeKey(Class<?> baseType, Object typeKey) {
+      this.baseType = baseType;
+      this.typeKey = typeKey;
+    }
+
+    @Override
+    public boolean equals(Object other) {
+      if (this == other) {
+        return true;
+      }
+      if (!(other instanceof SubtypeTypeKey)) {
+        return false;
+      }
+      SubtypeTypeKey that = (SubtypeTypeKey) other;
+      return baseType == that.baseType && typeKey.equals(that.typeKey);
+    }
+
+    @Override
+    public int hashCode() {
+      return 31 * System.identityHashCode(baseType) + typeKey.hashCode();
+    }
+  }
+
   private static TypeRef<?> typeRef(Type declaredType, Class<?> rawType) {
     if (declaredType == null || declaredType == Object.class && rawType != Object.class) {
       return TypeRef.of(rawType);
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/java/fory-json/src/main/java/org/apache/fory/json/resolver/UnsupportedJsonTypeException.java
similarity index 67%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to java/fory-json/src/main/java/org/apache/fory/json/resolver/UnsupportedJsonTypeException.java
index 142362da2..d12c8686d 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/java/fory-json/src/main/java/org/apache/fory/json/resolver/UnsupportedJsonTypeException.java
@@ -17,24 +17,15 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json.resolver;
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
+import org.apache.fory.annotation.Internal;
+import org.apache.fory.json.ForyJsonException;
 
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
-
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
+/** A module factory's deterministic claim that a recognized type is intentionally unsupported. */
+@Internal
+public final class UnsupportedJsonTypeException extends ForyJsonException {
+  public UnsupportedJsonTypeException(String message) {
+    super(message);
   }
 }
diff --git a/java/fory-json/src/main/java17/org/apache/fory/json/ForyJsonGraalVMFeature.java b/java/fory-json/src/main/java17/org/apache/fory/json/ForyJsonGraalVMFeature.java
index f436d51ae..638255b57 100644
--- a/java/fory-json/src/main/java17/org/apache/fory/json/ForyJsonGraalVMFeature.java
+++ b/java/fory-json/src/main/java17/org/apache/fory/json/ForyJsonGraalVMFeature.java
@@ -65,6 +65,7 @@ import org.apache.fory.json.codegen.JsonCodegenKey;
 import org.apache.fory.json.meta.JsonCreatorInfo;
 import org.apache.fory.json.meta.JsonFieldAccessor;
 import org.apache.fory.json.meta.JsonValidatorInfo;
+import org.apache.fory.json.resolver.CodecRegistry.FactoryBinding;
 import org.apache.fory.json.resolver.JsonGeneratedClassRegistry;
 import org.apache.fory.json.resolver.JsonSharedRegistry;
 import org.apache.fory.json.resolver.JsonSharedRegistry.JsonMixinView;
@@ -80,6 +81,12 @@ import org.graalvm.nativeimage.hosted.RuntimeReflection;
 
 /** Prepares reachable Fory JSON models and provider-selected codecs for Native Image. */
 final class ForyJsonGraalVMFeature implements Feature {
+  private static final String SCALA_DERIVED_CODEC_METHOD = "derived$ScalaJsonCodec";
+  private static final String SCALA_JSON_CODEC_CLASS =
+      "org.apache.fory.json.scala.ScalaJsonCodec";
+  private static final String SCALA_JSON_CODEC_FACTORY =
+      "org.apache.fory.json.scala.internal.ScalaTypeCodecFactory$";
+  private static final String SCALA_ENUM_CLASS = "scala.reflect.Enum";
   private static final String[] SQL_TYPES = {
     "java.sql.Date", "java.sql.Time", "java.sql.Timestamp"
   };
@@ -91,6 +98,8 @@ final class ForyJsonGraalVMFeature implements Feature {
   private final Set<Class<?>> processedMixins = ConcurrentHashMap.newKeySet();
   private final Map<Class<?>, Set<Class<?>>> reachableMixins = new LinkedHashMap<>();
   private final Set<Class<?>> processedProviders = ConcurrentHashMap.newKeySet();
+  private final Set<Class<?>> processedFactoryModels = ConcurrentHashMap.newKeySet();
+  private final Set<Class<?>> scalaDerivedModels = ConcurrentHashMap.newKeySet();
   private final Set<Class<?>> processedCodecs = ConcurrentHashMap.newKeySet();
   private final Set<Class<?>> processedContainers = ConcurrentHashMap.newKeySet();
   private final Set<Executable> processedCreators = new LinkedHashSet<>();
@@ -126,6 +135,7 @@ final class ForyJsonGraalVMFeature implements Feature {
       if (processedReachableTypes.add(type)) {
         changed |= registerContainer(type);
         changed |= registerDeclarations(type);
+        changed |= registerScalaDerivedCodec(access, type);
         if (type.getDeclaredAnnotation(JsonType.class) != null) {
           changed |= registerModel(access, type);
         }
@@ -134,7 +144,7 @@ final class ForyJsonGraalVMFeature implements Feature {
           changed |= registerMixin(access, type, mixin.target());
         }
         if (type.getDeclaredAnnotation(ForyJsonProvider.class) != null) {
-          changed |= registerProvider(type);
+          changed |= registerProvider(access, type);
         }
         if (type == ForyJson.class) {
           registerBuiltInTypes(access);
@@ -148,7 +158,37 @@ final class ForyJsonGraalVMFeature implements Feature {
     }
   }
 
-  private boolean registerProvider(Class<?> providerClass) {
+  private boolean registerScalaDerivedCodec(DuringAnalysisAccess access, Class<?> type) {
+    boolean scalaEnum = false;
+    for (Class<?> interfaceType : type.getInterfaces()) {
+      if (interfaceType.getName().equals(SCALA_ENUM_CLASS)) {
+        scalaEnum = true;
+        break;
+      }
+    }
+    if (!scalaEnum) {
+      return false;
+    }
+    Method method;
+    try {
+      method = type.getDeclaredMethod(SCALA_DERIVED_CODEC_METHOD);
+    } catch (NoSuchMethodException ignored) {
+      return false;
+    }
+    int modifiers = method.getModifiers();
+    if (!Modifier.isPublic(modifiers)
+        || !Modifier.isStatic(modifiers)
+        || method.getParameterCount() != 0
+        || !method.getReturnType().getName().equals(SCALA_JSON_CODEC_CLASS)) {
+      return false;
+    }
+    RuntimeReflection.register(method);
+    scalaDerivedModels.add(type);
+    registerFactoryModel(access, type);
+    return true;
+  }
+
+  private boolean registerProvider(DuringAnalysisAccess access, Class<?> providerClass) {
     if (!processedProviders.add(providerClass)) {
       return false;
     }
@@ -200,21 +240,51 @@ final class ForyJsonGraalVMFeature implements Feature {
         hostedConfigurations.put(key, configurations);
       }
       ClassLoader classLoader = config.classLoader();
-      boolean knownLoader = false;
-      for (HostedConfiguration configuration : configurations) {
-        if (configuration.classLoader == classLoader) {
-          knownLoader = true;
+      HostedConfiguration configuration = null;
+      for (HostedConfiguration candidate : configurations) {
+        if (candidate.classLoader == classLoader) {
+          configuration = candidate;
           break;
         }
       }
-      if (!knownLoader) {
-        configurations.add(new HostedConfiguration(config));
+      if (configuration == null) {
+        configuration = new HostedConfiguration(config);
+        configurations.add(configuration);
         changed = true;
       }
+      ArrayList<Map.Entry<Class<?>, FactoryBinding>> bindings =
+          new ArrayList<>(config.codecRegistry().factoryBindings().entrySet());
+      bindings.sort(Comparator.comparing(entry -> entry.getKey().getName()));
+      for (Map.Entry<Class<?>, FactoryBinding> entry : bindings) {
+        changed |= addFactoryRoot(access, configuration, entry.getKey());
+        for (Class<?> runtimeType : entry.getValue().handledRuntimeClasses()) {
+          changed |= registerFactoryModel(access, runtimeType);
+        }
+      }
     }
     return changed;
   }
 
+  private boolean addFactoryRoot(
+      DuringAnalysisAccess access, HostedConfiguration configuration, Class<?> type) {
+    boolean changed = configuration.factoryModels.add(type);
+    return registerFactoryModel(access, type) || changed;
+  }
+
+  private boolean registerFactoryModel(DuringAnalysisAccess access, Class<?> type) {
+    if (processedModels.contains(type) || !processedFactoryModels.add(type)) {
+      return false;
+    }
+    RuntimeReflection.register(type);
+    registerContainer(type);
+    registerDeclarations(type);
+    registerModelHierarchy(access, type);
+    if (type.isRecord()) {
+      registerRecord(type);
+    }
+    return true;
+  }
+
   private static MethodHandle providerConstructor(
       Class<?> providerClass, Constructor<?> constructor) {
     try {
@@ -267,6 +337,10 @@ final class ForyJsonGraalVMFeature implements Feature {
         hostedConfigurations.entrySet()) {
       for (HostedConfiguration configuration : entry.getValue()) {
         LinkedHashSet<Class<?>> selectedModels = new LinkedHashSet<>(processedModels);
+        selectedModels.addAll(configuration.factoryModels);
+        if (configuration.scalaJsonCodecs) {
+          selectedModels.addAll(scalaDerivedModels);
+        }
         for (Map.Entry<Class<?>, Set<Class<?>>> mixin : reachableMixins.entrySet()) {
           if (mixin.getValue().contains(configuration.mixins.get(mixin.getKey()))) {
             selectedModels.add(mixin.getKey());
@@ -883,13 +957,23 @@ final class ForyJsonGraalVMFeature implements Feature {
     private final JsonSharedRegistry registry;
     private final JsonTypeResolver resolver;
     private final Map<Class<?>, Class<?>> mixins;
+    private final boolean scalaJsonCodecs;
     private final Set<Class<?>> processedModels = new LinkedHashSet<>();
+    private final Set<Class<?>> factoryModels = new LinkedHashSet<>();
 
     private HostedConfiguration(JsonConfig config) {
       classLoader = config.classLoader();
       registry = JsonSharedRegistry.forHostedCodegen(config);
       resolver = new JsonTypeResolver(registry);
       mixins = config.mixins();
+      boolean hasScalaJsonCodecs = false;
+      for (JsonCodecFactory factory : config.codecFactories()) {
+        if (factory.getClass().getName().equals(SCALA_JSON_CODEC_FACTORY)) {
+          hasScalaJsonCodecs = true;
+          break;
+        }
+      }
+      scalaJsonCodecs = hasScalaJsonCodecs;
     }
   }
 
diff --git a/java/fory-json/src/test/java/org/apache/fory/json/JsonAsyncCompilationTest.java b/java/fory-json/src/test/java/org/apache/fory/json/JsonAsyncCompilationTest.java
index 2af6e2700..6d385ba9f 100644
--- a/java/fory-json/src/test/java/org/apache/fory/json/JsonAsyncCompilationTest.java
+++ b/java/fory-json/src/test/java/org/apache/fory/json/JsonAsyncCompilationTest.java
@@ -1319,6 +1319,9 @@ public class JsonAsyncCompilationTest {
             2 * 1024 * 1024,
             codecs,
             Collections.<Class<?>, Class<?>>emptyMap(),
+            new JsonCodecFactory[0],
+            Collections.<String>emptyList(),
+            Collections.<String>emptyList(),
             null);
     ControlledExecutor executor = new ControlledExecutor();
     Constructor<JsonSharedRegistry> constructor =
diff --git a/java/fory-json/src/test/java/org/apache/fory/json/JsonCreatorTest.java b/java/fory-json/src/test/java/org/apache/fory/json/JsonCreatorTest.java
index ac0a6e162..59eae033b 100644
--- a/java/fory-json/src/test/java/org/apache/fory/json/JsonCreatorTest.java
+++ b/java/fory-json/src/test/java/org/apache/fory/json/JsonCreatorTest.java
@@ -26,6 +26,7 @@ import static org.testng.Assert.fail;
 
 import java.nio.charset.StandardCharsets;
 import org.apache.fory.json.annotation.JsonCreator;
+import org.apache.fory.json.annotation.JsonIgnore;
 import org.apache.fory.json.annotation.JsonProperty;
 import org.testng.annotations.Factory;
 import org.testng.annotations.Test;
@@ -51,6 +52,59 @@ public class JsonCreatorTest extends ForyJsonTestModels {
     assertEquals(utf8.name, "你好");
   }
 
+  @Test
+  public void fieldFallbacks() {
+    ForyJson json = newJson();
+    User spaced =
+        json.fromJson("{ \n \"id\" \t : 7, \"name\" : \"alice\", \"unknown\" : 1}", User.class);
+    assertEquals(spaced.id, 7L);
+    assertEquals(spaced.name, "alice");
+
+    User escaped =
+        json.fromJson(
+            "{\"\\u0069d\":8,\"unknown\":[1],\"name\":\"bob\"}".getBytes(StandardCharsets.UTF_8),
+            User.class);
+    assertEquals(escaped.id, 8L);
+    assertEquals(escaped.name, "bob");
+
+    User utf16 = json.fromJson("{\"unknown\":\"值\",\"id\" : 9,\"name\":\"你好\"}", User.class);
+    assertEquals(utf16.id, 9L);
+    assertEquals(utf16.name, "你好");
+  }
+
+  @Test
+  public void fieldPrefixCollision() {
+    ForyJson json = newJson();
+    PrefixCreator latin1 = json.fromJson("{\"abcTwo\":2,\"abcOne\":1}", PrefixCreator.class);
+    assertEquals(latin1.abcOne, 1);
+    assertEquals(latin1.abcTwo, 2);
+
+    PrefixCreator utf8 =
+        json.fromJson(
+            "{\"abcOne\":3,\"abcTwo\":4}".getBytes(StandardCharsets.UTF_8), PrefixCreator.class);
+    assertEquals(utf8.abcOne, 3);
+    assertEquals(utf8.abcTwo, 4);
+
+    PrefixCreator utf16 =
+        json.fromJson("{\"unknown\":\"值\",\"abcTwo\":6,\"abcOne\":5}", PrefixCreator.class);
+    assertEquals(utf16.abcOne, 5);
+    assertEquals(utf16.abcTwo, 6);
+  }
+
+  @Test
+  public void malformedFieldNames() {
+    ForyJson json = newJson();
+    assertThrows(
+        ForyJsonException.class, () -> json.fromJson("{\"id\" 7,\"name\":\"alice\"}", User.class));
+    assertThrows(
+        ForyJsonException.class,
+        () ->
+            json.fromJson(
+                "{\"id:7,\"name\":\"alice\"}".getBytes(StandardCharsets.UTF_8), User.class));
+    assertThrows(
+        ForyJsonException.class, () -> json.fromJson("{\"id\" 9,\"name\":\"你好\"}", User.class));
+  }
+
   @Test
   public void parameterLocalFactory() {
     ForyJson json = newJson();
@@ -149,6 +203,15 @@ public class JsonCreatorTest extends ForyJsonTestModels {
     assertEquals(value.value, 7);
   }
 
+  @Test
+  public void ignoredCreatorParameter() {
+    IgnoredCreator value =
+        newJson().fromJson("{\"visible\":7,\"hidden\":\"secret\"}", IgnoredCreator.class);
+    assertEquals(value.visible, 7);
+    assertEquals(value.hidden, "secret");
+    assertEquals(newJson().toJson(value), "{\"visible\":7}");
+  }
+
   static final class HiddenArgument {
     public int value;
   }
@@ -162,6 +225,19 @@ public class JsonCreatorTest extends ForyJsonTestModels {
     }
   }
 
+  public static final class IgnoredCreator {
+    public final int visible;
+    public final String hidden;
+
+    @JsonCreator
+    public IgnoredCreator(
+        @JsonProperty("visible") int visible,
+        @JsonProperty("hidden") @JsonIgnore(ignoreRead = false) String hidden) {
+      this.visible = visible;
+      this.hidden = hidden;
+    }
+  }
+
   public static final class User {
     public final long id;
     public final String name;
@@ -173,6 +249,17 @@ public class JsonCreatorTest extends ForyJsonTestModels {
     }
   }
 
+  public static final class PrefixCreator {
+    public final int abcOne;
+    public final int abcTwo;
+
+    @JsonCreator({"abcOne", "abcTwo"})
+    public PrefixCreator(int abcOne, int abcTwo) {
+      this.abcOne = abcOne;
+      this.abcTwo = abcTwo;
+    }
+  }
+
   public static final class CustomPrimitiveCreator {
     public final int id;
 
diff --git a/java/fory-json/src/test/java/org/apache/fory/json/JsonModuleTest.java b/java/fory-json/src/test/java/org/apache/fory/json/JsonModuleTest.java
new file mode 100644
index 000000000..a6c373031
--- /dev/null
+++ b/java/fory-json/src/test/java/org/apache/fory/json/JsonModuleTest.java
@@ -0,0 +1,358 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertThrows;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import org.apache.fory.json.codec.AbstractJsonValueCodec;
+import org.apache.fory.json.codec.CompositeJsonCodec;
+import org.apache.fory.json.codec.JsonValueCodec;
+import org.apache.fory.json.reader.JsonReader;
+import org.apache.fory.json.reader.Latin1JsonReader;
+import org.apache.fory.json.reader.Utf16JsonReader;
+import org.apache.fory.json.reader.Utf8JsonReader;
+import org.apache.fory.json.resolver.JsonTypeInfo;
+import org.apache.fory.json.resolver.JsonTypeResolver;
+import org.apache.fory.json.resolver.UnsupportedJsonTypeException;
+import org.apache.fory.json.writer.JsonWriter;
+import org.apache.fory.json.writer.StringJsonWriter;
+import org.apache.fory.json.writer.Utf8JsonWriter;
+import org.apache.fory.reflect.TypeRef;
+import org.testng.annotations.Test;
+
+public class JsonModuleTest {
+  @Test
+  public void installsOnceAndFreezesContext() {
+    AtomicInteger installs = new AtomicInteger();
+    ModuleContext[] retained = new ModuleContext[1];
+    ForyJsonModule module =
+        context -> {
+          installs.incrementAndGet();
+          retained[0] = context;
+          context.registerCodec(Text.class, new TextCodec("module:"));
+        };
+    ForyJson json = ForyJson.builder().withModule(module).withModule(module).build();
+    assertEquals(installs.get(), 1);
+    assertEquals(json.toJson(new Text("value")), "\"module:value\"");
+    assertThrows(
+        IllegalStateException.class,
+        () -> retained[0].registerCodec(Text.class, new TextCodec("late:")));
+  }
+
+  @Test
+  public void installationIsTransactional() {
+    AtomicBoolean fail = new AtomicBoolean(true);
+    ForyJsonModule module =
+        context -> {
+          context.registerCodec(Text.class, new TextCodec("module:"));
+          if (fail.getAndSet(false)) {
+            throw new IllegalStateException("failed install");
+          }
+        };
+    ForyJsonBuilder builder = ForyJson.builder().withModule(module);
+    assertThrows(IllegalStateException.class, builder::build);
+    ForyJson json = builder.build();
+    assertEquals(json.toJson(new Text("value")), "\"module:value\"");
+  }
+
+  @Test
+  public void applicationExactCodecWins() {
+    ForyJsonModule module = context -> context.registerCodec(Text.class, new TextCodec("module:"));
+    ForyJson json =
+        ForyJson.builder()
+            .withModule(module)
+            .registerCodec(Text.class, new TextCodec("application:"))
+            .build();
+    assertEquals(json.toJson(new Text("value")), "\"application:value\"");
+  }
+
+  @Test
+  public void duplicateModuleKeyFails() {
+    ForyJsonModule first = new KeyedModule("same");
+    ForyJsonModule second = new KeyedModule("same");
+    ForyJsonBuilder builder = ForyJson.builder().withModule(first).withModule(second);
+    assertThrows(IllegalArgumentException.class, builder::build);
+  }
+
+  @Test
+  public void conflictingFactoriesIgnoreOrder() {
+    ForyJsonModule first = new FactoryModule("first", new TextCodec("first:"), false);
+    ForyJsonModule second = new FactoryModule("second", null, true);
+    ForyJson left = ForyJson.builder().withModule(first).withModule(second).build();
+    ForyJson right = ForyJson.builder().withModule(second).withModule(first).build();
+    assertThrows(ForyJsonException.class, () -> left.toJson(new Family("value")));
+    assertThrows(ForyJsonException.class, () -> right.toJson(new Family("value")));
+  }
+
+  @Test
+  public void recursiveCompositeRollsBack() {
+    AtomicBoolean fail = new AtomicBoolean(true);
+    AtomicInteger creations = new AtomicInteger();
+    JsonCodecFactory factory =
+        (type, resolver) -> {
+          if (type.getRawType() != RecursiveValue.class) {
+            return null;
+          }
+          creations.incrementAndGet();
+          return new RecursiveCodec(fail);
+        };
+    ForyJsonModule module = context -> context.registerCodecFactory(factory);
+    ForyJson json = ForyJson.builder().withModule(module).withCodegen(false).build();
+    assertThrows(
+        ForyJsonException.class, () -> json.fromJson("{\"next\":null}", RecursiveValue.class));
+    RecursiveValue value = json.fromJson("{\"next\":{\"next\":null}}", RecursiveValue.class);
+    assertEquals(json.toJson(value), "{\"next\":{\"next\":null}}");
+    assertEquals(creations.get(), 2);
+  }
+
+  @Test
+  public void runtimeCompositeRollsBack() {
+    AtomicBoolean fail = new AtomicBoolean(true);
+    AtomicInteger creations = new AtomicInteger();
+    JsonCodecFactory factory =
+        (type, resolver) -> {
+          if (type.getRawType() != RecursiveValue.class) {
+            return null;
+          }
+          creations.incrementAndGet();
+          return new RecursiveCodec(fail);
+        };
+    ForyJson json =
+        ForyJson.builder()
+            .withModule(context -> context.registerCodecFactory(factory))
+            .withCodegen(false)
+            .build();
+
+    RecursiveValue value = new RecursiveValue(new RecursiveValue(null));
+    assertThrows(ForyJsonException.class, () -> json.toJson(value));
+    assertEquals(json.toJson(value), "{\"next\":{\"next\":null}}");
+    assertEquals(creations.get(), 2);
+
+    // A dynamic write binding must not authorize or populate a declared read binding.
+    RecursiveValue decoded = json.fromJson("{\"next\":{\"next\":null}}", RecursiveValue.class);
+    assertEquals(json.toJson(decoded), "{\"next\":{\"next\":null}}");
+    assertEquals(creations.get(), 3);
+  }
+
+  private static final class KeyedModule implements ForyJsonModule {
+    private final String key;
+
+    private KeyedModule(String key) {
+      this.key = key;
+    }
+
+    @Override
+    public String moduleKey() {
+      return key;
+    }
+
+    @Override
+    public void install(ModuleContext context) {}
+  }
+
+  private static final class FactoryModule implements ForyJsonModule {
+    private final String key;
+    private final JsonValueCodec<?> codec;
+    private final boolean reject;
+
+    private FactoryModule(String key, JsonValueCodec<?> codec, boolean reject) {
+      this.key = key;
+      this.codec = codec;
+      this.reject = reject;
+    }
+
+    @Override
+    public String moduleKey() {
+      return key;
+    }
+
+    @Override
+    public void install(ModuleContext context) {
+      context.registerCodecFactory(
+          new JsonCodecFactory() {
+            @Override
+            public JsonValueCodec<?> create(TypeRef<?> type, JsonTypeResolver resolver) {
+              if (type.getRawType() != Family.class) {
+                return null;
+              }
+              if (reject) {
+                throw new UnsupportedJsonTypeException("rejected by " + key);
+              }
+              return codec;
+            }
+
+            @Override
+            public String factoryKey() {
+              return key;
+            }
+          });
+    }
+  }
+
+  private static final class TextCodec extends AbstractJsonValueCodec<Text> {
+    private final String prefix;
+
+    private TextCodec(String prefix) {
+      this.prefix = prefix;
+    }
+
+    @Override
+    public void write(JsonWriter writer, Text value) {
+      if (value == null) {
+        writer.writeNull();
+      } else {
+        writer.writeString(prefix + value.value);
+      }
+    }
+
+    @Override
+    public Text read(JsonReader reader) {
+      return reader.tryReadNullToken() ? null : new Text(reader.readString());
+    }
+  }
+
+  private static final class RecursiveCodec implements CompositeJsonCodec<RecursiveValue> {
+    private final AtomicBoolean fail;
+    private JsonTypeInfo self;
+
+    private RecursiveCodec(AtomicBoolean fail) {
+      this.fail = fail;
+    }
+
+    @Override
+    public void resolveTypes(TypeRef<?> type, JsonTypeResolver resolver) {
+      self = resolver.getTypeInfo(type.getType(), type.getRawType());
+      if (fail.getAndSet(false)) {
+        throw new ForyJsonException("forced recursive resolution failure");
+      }
+    }
+
+    @Override
+    public void writeString(StringJsonWriter writer, RecursiveValue value) {
+      if (value == null) {
+        writer.writeNull();
+        return;
+      }
+      writer.writeObjectStart();
+      writer.writeFieldName("next");
+      self.stringWriter().writeString(writer, value.next);
+      writer.writeObjectEnd();
+    }
+
+    @Override
+    public void writeUtf8(Utf8JsonWriter writer, RecursiveValue value) {
+      if (value == null) {
+        writer.writeNull();
+        return;
+      }
+      writer.writeObjectStart();
+      writer.writeFieldName("next");
+      self.utf8Writer().writeUtf8(writer, value.next);
+      writer.writeObjectEnd();
+    }
+
+    @Override
+    public RecursiveValue readLatin1(Latin1JsonReader reader) {
+      if (reader.tryReadNullToken()) {
+        return null;
+      }
+      reader.enterDepth();
+      reader.expectNextToken('{');
+      expectNext(reader.readFieldName());
+      reader.expectNextToken(':');
+      RecursiveValue result =
+          new RecursiveValue((RecursiveValue) self.latin1Reader().readLatin1(reader));
+      expectEnd(reader.consumeNextCommaOrEndObject());
+      reader.exitDepth();
+      return result;
+    }
+
+    @Override
+    public RecursiveValue readUtf16(Utf16JsonReader reader) {
+      if (reader.tryReadNullToken()) {
+        return null;
+      }
+      reader.enterDepth();
+      reader.expectNextToken('{');
+      expectNext(reader.readFieldName());
+      reader.expectNextToken(':');
+      RecursiveValue result =
+          new RecursiveValue((RecursiveValue) self.utf16Reader().readUtf16(reader));
+      expectEnd(reader.consumeNextCommaOrEndObject());
+      reader.exitDepth();
+      return result;
+    }
+
+    @Override
+    public RecursiveValue readUtf8(Utf8JsonReader reader) {
+      if (reader.tryReadNullToken()) {
+        return null;
+      }
+      reader.enterDepth();
+      reader.expectNextToken('{');
+      expectNext(reader.readFieldName());
+      reader.expectNextToken(':');
+      RecursiveValue result =
+          new RecursiveValue((RecursiveValue) self.utf8Reader().readUtf8(reader));
+      expectEnd(reader.consumeNextCommaOrEndObject());
+      reader.exitDepth();
+      return result;
+    }
+
+    private static void expectNext(String name) {
+      if (!"next".equals(name)) {
+        throw new ForyJsonException("Expected recursive next property");
+      }
+    }
+
+    private static void expectEnd(boolean hasMore) {
+      if (hasMore) {
+        throw new ForyJsonException("Expected one recursive property");
+      }
+    }
+  }
+
+  private static final class Text {
+    private final String value;
+
+    private Text(String value) {
+      this.value = value;
+    }
+  }
+
+  private static final class Family {
+    private final String value;
+
+    private Family(String value) {
+      this.value = value;
+    }
+  }
+
+  private static final class RecursiveValue {
+    private final RecursiveValue next;
+
+    private RecursiveValue(RecursiveValue next) {
+      this.next = next;
+    }
+  }
+}
diff --git a/java/fory-json/src/test/java/org/apache/fory/json/JsonObjectTest.java b/java/fory-json/src/test/java/org/apache/fory/json/JsonObjectTest.java
index e3195a73a..28797d627 100644
--- a/java/fory-json/src/test/java/org/apache/fory/json/JsonObjectTest.java
+++ b/java/fory-json/src/test/java/org/apache/fory/json/JsonObjectTest.java
@@ -34,6 +34,7 @@ import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.Future;
+import org.apache.fory.json.annotation.JsonIgnore;
 import org.apache.fory.json.data.DeclaredParentField;
 import org.apache.fory.json.data.DirectionalIgnore;
 import org.apache.fory.json.data.FirstIntField;
@@ -299,4 +300,48 @@ public class JsonObjectTest extends ForyJsonTestModels {
     assertEquals(value.writeOnly, 2);
     assertEquals(value.readOnly, 9);
   }
+
+  @Test
+  public void methodIgnore() {
+    ForyJson json = newJson();
+    MethodIgnored value = new MethodIgnored();
+    assertEquals(json.toJson(value), "{\"visible\":1}");
+    MethodIgnored decoded =
+        json.fromJson("{\"hidden\":9,\"inputOnly\":8,\"visible\":7}", MethodIgnored.class);
+    assertEquals(decoded.hidden, 2);
+    assertEquals(decoded.inputOnly, 8);
+    assertEquals(decoded.visible, 7);
+  }
+
+  public static final class MethodIgnored {
+    public int hidden = 2;
+    public int inputOnly = 3;
+    public int visible = 1;
+
+    @JsonIgnore
+    public int getHidden() {
+      return hidden;
+    }
+
+    public void setHidden(int hidden) {
+      this.hidden = hidden;
+    }
+
+    @JsonIgnore(ignoreRead = false)
+    public int getInputOnly() {
+      return inputOnly;
+    }
+
+    public void setInputOnly(int inputOnly) {
+      this.inputOnly = inputOnly;
+    }
+
+    public int getVisible() {
+      return visible;
+    }
+
+    public void setVisible(int visible) {
+      this.visible = visible;
+    }
+  }
 }
diff --git a/java/fory-json/src/test/java/org/apache/fory/json/JsonTestSupport.java b/java/fory-json/src/test/java/org/apache/fory/json/JsonTestSupport.java
index 4e7d86644..e5d7f6f36 100644
--- a/java/fory-json/src/test/java/org/apache/fory/json/JsonTestSupport.java
+++ b/java/fory-json/src/test/java/org/apache/fory/json/JsonTestSupport.java
@@ -50,6 +50,9 @@ final class JsonTestSupport {
           2 * 1024 * 1024,
           new CodecRegistry(),
           Collections.<Class<?>, Class<?>>emptyMap(),
+          new JsonCodecFactory[0],
+          Collections.<String>emptyList(),
+          Collections.<String>emptyList(),
           null);
   private static final JsonSharedRegistry REGISTRY = new JsonSharedRegistry(CONFIG);
   private static final JsonValueCodec<Object> NULL_CODEC =
diff --git a/scala/README.md b/scala/README.md
index c8f399833..7e38be365 100644
--- a/scala/README.md
+++ b/scala/README.md
@@ -1,208 +1,16 @@
-# Apache Fory™ Scala
+# Apache Fory Scala
 
-Apache Fory™ Scala provides optimized serializers for Scala types, built on top of Fory Java. It delivers **high-performance serialization** for the Scala ecosystem with full support for Scala-specific types and idioms.
+Apache Fory publishes two Scala artifacts for Scala 2.13 and Scala 3:
 
-Both Scala 2 and Scala 3 are supported.
+| Artifact                           | Purpose                                   |
+| ---------------------------------- | ----------------------------------------- |
+| `org.apache.fory::fory-scala`      | Fory binary serialization for Scala types |
+| `org.apache.fory::fory-json-scala` | Fory JSON support for Scala types         |
 
-Scala uses xlang mode for cross-language payloads by default. Use native mode
-with `.withXlang(false)` for Scala/JVM-only traffic when you want the JVM native
-object serialization path plus Scala-specific types such as case classes,
-collections, tuples, options, and enumerations.
+The modules support the ordinary JVM and GraalVM Native Image. Android is not supported.
 
-## Features
-
-### Supported Types
-
-Apache Fory™ Scala is tested and works with the following types:
-
-- **Case classes**: Full support for case class serialization with all field types
-- **Regular classes**: POJO/bean style classes with constructor parameters
-- **Object singletons**: Scala `object` singletons preserve identity after deserialization
-- **Collections**: `Seq`, `List`, `Vector`, `Set`, `Map`, `ArrayBuffer`, and other Scala collections
-- **Tuples**: All tuple types from `Tuple1` to `Tuple22`
-- **Option types**: `Some` and `None`
-- **Either types**: `Left` and `Right`
-- **Enumerations**: Both Scala 2 `Enumeration` and Scala 3 `enum`
-
-### Scala-Specific Features
-
-- **Default Value Support**: Automatic handling of Scala class default parameters during schema evolution
-- **Singleton Preservation**: `object` singletons maintain referential equality after deserialization
-- **Scala Collection Optimization**: Optimized serializers for Scala's immutable and mutable collections
-
-## Quick Start
-
-```scala
-import org.apache.fory.Fory
-import org.apache.fory.scala.ForyScala
-
-case class Person(name: String, id: Long, github: String)
-case class Point(x: Int, y: Int, z: Int)
-
-object ScalaExample {
-  val fory: Fory = ForyScala.builder()
-    .withXlang(true)
-    .build()
-
-  fory.register(classOf[Person])
-  fory.register(classOf[Point])
-
-  def main(args: Array[String]): Unit = {
-    val p = Person("Shawn Yang", 1, "https://github.com/chaokunyang")
-    println(fory.deserialize(fory.serialize(p)))
-    println(fory.deserialize(fory.serialize(Point(1, 2, 3))))
-  }
-}
-```
-
-## Default Value Support
-
-Apache Fory™ Scala provides support for Scala class default values during deserialization. This feature enables forward/backward compatibility when case classes or regular Scala classes have default parameters.
-
-### How It Works
-
-When a Scala class has default parameters, the Scala compiler generates methods in the companion object (for case classes) or in the class itself that return default values. Fory detects these methods and uses them when deserializing objects where certain fields are missing from the serialized data.
-
-### Native-Mode Example
-
-```scala
-import org.apache.fory.Fory
-import org.apache.fory.scala.ForyScala
-
-// Original case class
-case class User(name: String, age: Int)
-
-// Evolved case class with new fields and default values
-case class UserV2(name: String, age: Int, email: String = "unknown", active: Boolean = true)
-
-object DefaultValueExample {
-  val fory: Fory = ForyScala.builder().withXlang(false)
-    .build()
-
-  def main(args: Array[String]): Unit = {
-    // Serialize with old schema
-    val oldUser = User("John", 30)
-    val serialized = fory.serialize(oldUser)
-
-    // Deserialize with new schema - missing fields get default values
-    val newUser = fory.deserialize(serialized).asInstanceOf[UserV2]
-    println(newUser) // UserV2(John, 30, unknown, true)
-  }
-}
-```
-
-### Supported Default Value Types
-
-- **Primitive types**: `Int`, `Long`, `Double`, `Float`, `Boolean`, `Byte`, `Short`, `Char`
-- **String**: `String`
-- **Collections**: `List`, `Set`, `Map`, `Seq`, etc.
-- **Option types**: `Option[T]`
-- **Custom objects**: Any serializable object
-
-## Thread-Safe Usage
-
-For multi-threaded applications, use `ThreadSafeFory`:
-
-```scala
-import org.apache.fory.{Fory, ThreadSafeFory}
-import org.apache.fory.scala.ForyScala
-
-object ForyHolder {
-  val fory: ThreadSafeFory = ForyScala.builder()
-    .withXlang(true)
-    .buildThreadSafeFory()
-
-  fory.register(classOf[Person])
-}
-
-// Use in multiple threads
-val bytes = ForyHolder.fory.serialize(person)
-val result = ForyHolder.fory.deserialize(bytes)
-```
-
-## Configuration
-
-Fory Scala is built on Fory Java, so all Java configuration options are available. The default
-builder uses xlang mode with compatible schema evolution:
-
-```scala
-val fory = ForyScala.builder()
-  .withXlang(true)
-  .build()
-```
-
-Native-mode payloads can opt into JVM schema evolution explicitly:
-
-```scala
-import org.apache.fory.Fory
-import org.apache.fory.scala.ForyScala
-
-val fory = ForyScala.builder().withXlang(false)
-  // Enable reference tracking for circular references
-  .withRefTracking(true)
-  // Compatible schema evolution is enabled by default
-  // Enable async compilation for better startup performance
-  .withAsyncCompilation(true)
-  // Compression options
-  .withIntCompressed(true)
-  .withLongCompressed(true)
-  .build()
-```
-
-## Documentation
-
-| Resource          | Link                                                                           |
-| ----------------- | ------------------------------------------------------------------------------ |
-| **Website**       | https://fory.apache.org/docs/object-serialization/scala                        |
-| **Source Docs**   | [docs/object-serialization/scala](../docs/object-serialization/scala/index.md) |
-| **Java Guide**    | [docs/object-serialization/java](../docs/object-serialization/java/index.md)   |
-| **API Reference** | [Fory Java API](../java/README.md)                                             |
-
-## Installation
-
-Add the dependency with sbt:
-
-```sbt
-libraryDependencies += "org.apache.fory" %% "fory-scala" % "1.6.0"
-```
-
-## Building
-
-Fory Scala requires Fory Java to be installed first:
-
-```bash
-# Install Fory Java
-cd ../java && mvn -T16 install -DskipTests
-
-# Build Fory Scala
-cd ../scala
-sbt compile
-```
-
-## Testing
-
-```bash
-sbt test
-```
-
-## Code Format
-
-```bash
-cd ..
-ci/format.sh
-```
-
-The Scala module does not currently wire a `scalafmt` sbt command.
-
-## Additional Notes
-
-- **Fory Reuse**: Always reuse Fory instances; creation is expensive
-- **Scala Internal Types**: You may need to register some Scala internal types like `scala.Enumeration.Val`
-
-## Contributing
-
-See [CONTRIBUTING.md](../CONTRIBUTING.md) for development guidelines.
-
-## License
+- [Binary Scala module](fory-scala/README.md)
+- [Scala JSON module](fory-json-scala/README.md)
+- [Scala JSON guide](../docs/json/scala.md)
 
 Licensed under the [Apache License 2.0](../LICENSE).
diff --git a/scala/build.sbt b/scala/build.sbt
index 552fdea4f..374bce62c 100644
--- a/scala/build.sbt
+++ b/scala/build.sbt
@@ -18,10 +18,12 @@
 
 val foryVersion = "1.7.0-SNAPSHOT"
 val scala213Version = "2.13.15"
+val repositoryRoot = Def.setting((ThisBuild / baseDirectory).value.getParentFile)
+
 ThisBuild / apacheSonatypeProjectProfile := "fory"
-version := foryVersion
-scalaVersion := scala213Version
-crossScalaVersions := Seq(scala213Version, "3.3.1")
+ThisBuild / version := foryVersion
+ThisBuild / scalaVersion := scala213Version
+ThisBuild / crossScalaVersions := Seq(scala213Version, "3.3.1")
 
 val localForyResolver =
   sys.props
@@ -29,53 +31,85 @@ val localForyResolver =
     .map(repo => "Local Fory Maven Repository" at repo)
     .getOrElse(Resolver.mavenLocal)
 
-lazy val root = Project(id = "fory-scala", base = file("."))
-  .settings(
-    name := "fory-scala",
-    apacheSonatypeLicenseFile := baseDirectory.value / ".." / "LICENSE",
-    apacheSonatypeNoticeFile := baseDirectory.value / ".." / "NOTICE",
-    description := "Apache Fory™ is a blazingly fast multi-language serialization framework powered by JIT and zero-copy.",
-    homepage := Some(url("https://fory.apache.org/")),
-    scmInfo := Some(
-      ScmInfo(
-        url("https://github.com/apache/fory"),
-        "scm:git:https://github.com/apache/fory.git",
-        Some("scm:git:https://github.com/apache/fory.git"))),
-    startYear := Some(2024),
-    developers := List(
-      Developer(
-        "fory-contributors",
-        "Apache Fory™ Contributors",
-        "dev@fory.apache.org",
-        url("https://github.com/apache/fory/graphs/contributors"))))
-
 ThisBuild / externalResolvers := Seq(
   Resolver.mavenCentral,
   Resolver.ApacheMavenSnapshotsRepo,
   localForyResolver,
 )
 
-libraryDependencies ++= Seq(
-  "org.apache.fory" % "fory-core" % foryVersion,
-  "org.scalatest" %% "scalatest" % "3.2.19" % Test,
-  "dev.zio" %% "zio" % "2.1.7" % Test,
+lazy val commonSettings = Seq(
+  apacheSonatypeLicenseFile := repositoryRoot.value / "LICENSE",
+  apacheSonatypeNoticeFile := repositoryRoot.value / "NOTICE",
+  description := "Apache Fory™ is a blazingly fast multi-language serialization framework powered by JIT and zero-copy.",
+  homepage := Some(url("https://fory.apache.org/")),
+  scmInfo := Some(
+    ScmInfo(
+      url("https://github.com/apache/fory"),
+      "scm:git:https://github.com/apache/fory.git",
+      Some("scm:git:https://github.com/apache/fory.git")
+    )
+  ),
+  startYear := Some(2024),
+  developers := List(
+    Developer(
+      "fory-contributors",
+      "Apache Fory™ Contributors",
+      "dev@fory.apache.org",
+      url("https://github.com/apache/fory/graphs/contributors")
+    )
+  ),
+  Test / fork := true,
 )
 
-Test / fork := true
+lazy val foryScala = Project(id = "fory-scala", base = file("fory-scala"))
+  .settings(commonSettings)
+  .settings(
+    name := "fory-scala",
+    libraryDependencies ++= Seq(
+      "org.apache.fory" % "fory-core" % foryVersion,
+      "org.scalatest" %% "scalatest" % "3.2.19" % Test,
+      "dev.zio" %% "zio" % "2.1.7" % Test,
+    ),
+  )
+
+lazy val foryJsonScala = Project(id = "fory-json-scala", base = file("fory-json-scala"))
+  .settings(commonSettings)
+  .settings(
+    name := "fory-json-scala",
+    libraryDependencies ++= {
+      val reflect =
+        if (scalaBinaryVersion.value == "2.13")
+          Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided)
+        else Nil
+      Seq(
+        "org.apache.fory" % "fory-json" % foryVersion,
+        "org.scalatest" %% "scalatest" % "3.2.19" % Test,
+      ) ++ reflect
+    },
+  )
 
 lazy val writeTestClasspath = taskKey[File]("Writes the Scala test runtime classpath")
 
-writeTestClasspath := {
-  val output = target.value / "scala-xlang-test-classpath"
-  IO.write(
-    output,
-    (Test / fullClasspath).value.map(_.data.getAbsolutePath).mkString(java.io.File.pathSeparator))
-  output
-}
+lazy val root = (project in file("."))
+  .aggregate(foryScala, foryJsonScala)
+  .settings(
+    name := "fory-scala-parent",
+    publish / skip := true,
+    crossScalaVersions := Nil,
+    apacheSonatypeLicenseFile := repositoryRoot.value / "LICENSE",
+    apacheSonatypeNoticeFile := repositoryRoot.value / "NOTICE",
+    writeTestClasspath := {
+      val output = target.value / "scala-xlang-test-classpath"
+      IO.write(
+        output,
+        (foryScala / Test / fullClasspath).value
+          .map(_.data.getAbsolutePath)
+          .mkString(java.io.File.pathSeparator),
+      )
+      output
+    },
+  )
 
-// Exclude sonatypeRelease and sonatypeBundleRelease commands because we
-// don't want to release this project to Maven Central without having
-// to complete the release using the repository.apache.org web site.
 commands := commands.value.filterNot { command =>
   command.nameOption.exists { name =>
     name.contains("sonatypeRelease") || name.contains("sonatypeBundleRelease")
diff --git a/scala/fory-json-scala/README.md b/scala/fory-json-scala/README.md
new file mode 100644
index 000000000..ae8bd6b64
--- /dev/null
+++ b/scala/fory-json-scala/README.md
@@ -0,0 +1,40 @@
+# Apache Fory JSON for Scala
+
+`fory-json-scala` adds direct Scala type support to Fory JSON without converting values through
+Java collections or a JSON tree. It supports Scala 2.13 and Scala 3 on the ordinary JVM and GraalVM
+Native Image.
+
+Add the Scala artifact that matches the application Scala version:
+
+```sbt
+libraryDependencies += "org.apache.fory" %% "fory-json-scala" % "1.7.0-SNAPSHOT"
+```
+
+Create and reuse one Scala-aware Fory JSON instance:
+
+```scala
+import org.apache.fory.json.scala.ForyJsonScala
+
+case class Person(name: String, age: Int = 18, aliases: List[String] = Nil)
+
+val json = ForyJsonScala.builder().build()
+val text = json.toJson(Person("Ada"))
+val value = json.fromJson(text, classOf[Person])
+```
+
+The module supports case classes and their constructor defaults, mutable body properties, Scala
+collections and maps, `Option`, `Either`, tuples, ranges, durations, numeric wrappers, Scala 2
+`Enumeration`, and Scala 3 enums. Parameterized Scala types should use `TypeRef`; use `ScalaTypeRef`
+when a Scala value type would otherwise erase to `Object`:
+
+```scala
+import org.apache.fory.json.scala.ScalaTypeRef
+
+val rangeType = ScalaTypeRef[scala.collection.immutable.NumericRange[Int]]
+val range = json.fromJson("[1,3,5]", rangeType)
+```
+
+See the [Scala JSON guide](../../docs/json/scala.md) for the supported type table, annotations,
+closed enum derivation, unsupported runtime-state types, and GraalVM behavior.
+
+Licensed under the [Apache License 2.0](../../LICENSE).
diff --git a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/ScalaTypeRef.scala
similarity index 68%
copy from scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
copy to scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/ScalaTypeRef.scala
index f891272bc..93254ed23 100644
--- a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
+++ b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/ScalaTypeRef.scala
@@ -17,15 +17,13 @@
  * under the License.
  */
 
-package org.apache.fory.scala
+package org.apache.fory.json.scala
 
-import org.apache.fory.Fory
-import org.apache.fory.ForyModule
-import org.apache.fory.config.ForyBuilder
-import org.apache.fory.serializer.scala.ScalaSerializers
+import org.apache.fory.reflect.TypeRef
 
-object ForyScala extends ForyModule {
-  def builder(): ForyBuilder = Fory.builder().withModule(this)
+import scala.language.experimental.macros
 
-  override def install(fory: Fory): Unit = ScalaSerializers.registerSerializers(fory)
+/** Creates a Fory type token without losing Scala value-type arguments to JVM erasure. */
+object ScalaTypeRef {
+  def apply[T]: TypeRef[T] = macro internal.ScalaTypeRefMacros.create[T]
 }
diff --git a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala
similarity index 68%
copy from scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
copy to scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala
index f891272bc..4ee886ec3 100644
--- a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
+++ b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala
@@ -17,15 +17,10 @@
  * under the License.
  */
 
-package org.apache.fory.scala
+package org.apache.fory.json.scala.internal
 
-import org.apache.fory.Fory
-import org.apache.fory.ForyModule
-import org.apache.fory.config.ForyBuilder
-import org.apache.fory.serializer.scala.ScalaSerializers
+import org.apache.fory.json.JsonCodecFactory
 
-object ForyScala extends ForyModule {
-  def builder(): ForyBuilder = Fory.builder().withModule(this)
-
-  override def install(fory: Fory): Unit = ScalaSerializers.registerSerializers(fory)
+private[scala] object ScalaDerivedCodec {
+  def find(rootType: Class[_]): JsonCodecFactory = null
 }
diff --git a/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala
new file mode 100644
index 000000000..e45848769
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala-2/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala
@@ -0,0 +1,54 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import scala.reflect.macros.blackbox
+
+private[scala] object ScalaTypeRefMacros {
+  def create[T: c.WeakTypeTag](
+      c: blackbox.Context
+  ): c.Expr[org.apache.fory.reflect.TypeRef[T]] = {
+    import c.universe._
+
+    def rawClass(tpe: Type): Tree = {
+      val normalized = tpe.dealias
+      val symbol = normalized.typeSymbol
+      if (!symbol.isClass) c.abort(c.enclosingPosition, s"${normalized.toString} has no runtime class")
+      val rawType = symbol.asClass.toType
+      q"classOf[$rawType]"
+    }
+
+    def createTypeRef(tpe: Type): Tree = {
+      val normalized = tpe.dealias
+      val clazz = rawClass(normalized)
+      if (normalized.typeArgs.isEmpty) {
+        q"_root_.org.apache.fory.reflect.TypeRef.of($clazz)"
+      } else {
+        val children = normalized.typeArgs.map(createTypeRef)
+        q"_root_.org.apache.fory.reflect.TypeRef.ofDeclaredTypeArguments($clazz, null, _root_.java.util.Arrays.asList(..$children), null)"
+      }
+    }
+
+    val result = createTypeRef(weakTypeOf[T])
+    c.Expr[org.apache.fory.reflect.TypeRef[T]](
+      q"$result.asInstanceOf[_root_.org.apache.fory.reflect.TypeRef[${weakTypeOf[T]}]]"
+    )
+  }
+}
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaJsonCodec.scala
similarity index 54%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaJsonCodec.scala
index 142362da2..651a90c1d 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaJsonCodec.scala
@@ -17,24 +17,24 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json.scala
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
+import org.apache.fory.json.{ForyJsonBuilder, JsonCodecFactory}
 
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
+import scala.reflect.ClassTag
 
-  public String getId() {
-    return id;
-  }
+/** Compile-time JSON schema for one closed Scala 3 enum. */
+trait ScalaJsonCodec[T] extends JsonCodecFactory
 
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
-
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
-  }
+object ScalaJsonCodec {
+  inline def derived[T]: ScalaJsonCodec[T] =
+    ${ org.apache.fory.json.scala.internal.ScalaJsonCodecMacros.derive[T] }
 }
+
+extension (builder: ForyJsonBuilder)
+  /** Derives and registers a closed schema for a third-party Scala 3 enum. */
+  inline def register[T](using tag: ClassTag[T]): ForyJsonBuilder =
+    builder.registerCodec(
+      tag.runtimeClass.asInstanceOf[Class[T]],
+      ScalaJsonCodec.derived[T]
+    )
diff --git a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaTypeRef.scala
similarity index 68%
copy from scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
copy to scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaTypeRef.scala
index f891272bc..9e0ecfd0a 100644
--- a/scala/src/main/scala/org/apache/fory/scala/ForyScala.scala
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/ScalaTypeRef.scala
@@ -17,15 +17,12 @@
  * under the License.
  */
 
-package org.apache.fory.scala
+package org.apache.fory.json.scala
 
-import org.apache.fory.Fory
-import org.apache.fory.ForyModule
-import org.apache.fory.config.ForyBuilder
-import org.apache.fory.serializer.scala.ScalaSerializers
+import org.apache.fory.reflect.TypeRef
 
-object ForyScala extends ForyModule {
-  def builder(): ForyBuilder = Fory.builder().withModule(this)
-
-  override def install(fory: Fory): Unit = ScalaSerializers.registerSerializers(fory)
+/** Creates a Fory type token without losing Scala value-type arguments to JVM erasure. */
+object ScalaTypeRef {
+  inline def apply[T]: TypeRef[T] =
+    ${ org.apache.fory.json.scala.internal.ScalaTypeRefMacros.create[T] }
 }
diff --git a/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/DerivedScalaJsonCodec.scala b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/DerivedScalaJsonCodec.scala
new file mode 100644
index 000000000..3a5ba3a8d
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/DerivedScalaJsonCodec.scala
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import java.lang.reflect.Modifier
+import java.util.{ArrayList, Collections, HashSet, List => JList}
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.annotation.JsonSubTypes.Inclusion
+import org.apache.fory.json.codec.{ClosedSubtypeCodec, JsonSubTypesInfo, JsonValueCodec}
+import org.apache.fory.json.resolver.JsonTypeResolver
+import org.apache.fory.json.scala.ScalaJsonCodec
+import org.apache.fory.reflect.TypeRef
+
+private[scala] final class DerivedScalaJsonCodec[T](
+    rootType: Class[T],
+    caseClasses: Array[Class[_]],
+    caseNames: Array[String],
+    singletonCases: Array[AnyRef]
+) extends ScalaJsonCodec[T] {
+  if (
+    caseClasses.length == 0 || caseClasses.length != caseNames.length ||
+    caseClasses.length != singletonCases.length
+  )
+    throw new IllegalArgumentException("A derived Scala enum must have a non-empty case table")
+
+  private val classes = caseClasses.clone()
+  private val names = caseNames.clone()
+  private val singletons = singletonCases.clone()
+  private val handled: JList[Class[_]] = {
+    val result = new ArrayList[Class[_]](classes.length)
+    val classSet = new HashSet[Class[_]](classes.length * 2)
+    val nameSet = new HashSet[String](names.length * 2)
+    var index = 0
+    while (index < classes.length) {
+      val caseClass = classes(index)
+      val name = names(index)
+      if (
+        caseClass == null || !rootType.isAssignableFrom(caseClass) ||
+        Modifier.isAbstract(caseClass.getModifiers)
+      ) throw new IllegalArgumentException(s"Invalid derived Scala enum case $caseClass")
+      if (name == null || name.isEmpty || !nameSet.add(name))
+        throw new IllegalArgumentException(s"Invalid derived Scala enum case name $name")
+      val singleton = singletons(index)
+      if (singleton != null && singleton.getClass != caseClass)
+        throw new IllegalArgumentException(s"Invalid derived Scala enum singleton $name")
+      if (classSet.add(caseClass)) result.add(caseClass)
+      else if (singleton == null)
+        throw new IllegalArgumentException(s"Duplicate derived Scala enum case ${caseClass.getName}")
+      index += 1
+    }
+    Collections.unmodifiableList(result)
+  }
+  private val key = {
+    val builder = new StringBuilder(rootType.getName.length + classes.length * 48)
+    append(builder, rootType.getName)
+    var index = 0
+    while (index < classes.length) {
+      append(builder, names(index))
+      append(builder, classes(index).getName)
+      index += 1
+    }
+    builder.toString
+  }
+
+  override def factoryKey(): String = key
+
+  override def handledRuntimeClasses(): JList[Class[_]] = handled
+
+  override def create(typeRef: TypeRef[_], resolver: JsonTypeResolver): JsonValueCodec[_] = {
+    if (typeRef.getRawType != rootType)
+      throw new ForyJsonException(s"Derived Scala enum codec expected ${rootType.getName}")
+    new ClosedSubtypeCodec(
+      rootType,
+      new JsonSubTypesInfo(Inclusion.WRAPPER_OBJECT, "", classes.clone(), names.clone()),
+      typeRef,
+      singletons.clone()
+    )
+  }
+
+  private def append(builder: StringBuilder, value: String): Unit =
+    builder.append(value.length).append(':').append(value)
+}
diff --git a/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala
new file mode 100644
index 000000000..d5c1dab9b
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaDerivedCodec.scala
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import java.lang.reflect.Modifier
+
+import org.apache.fory.json.{ForyJsonException, JsonCodecFactory}
+import org.apache.fory.json.scala.ScalaJsonCodec
+
+private[scala] object ScalaDerivedCodec {
+  private val MethodName = "derived$ScalaJsonCodec"
+
+  def find(rootType: Class[_]): JsonCodecFactory = {
+    val method =
+      try rootType.getDeclaredMethod(MethodName)
+      catch { case _: NoSuchMethodException => return null }
+    val modifiers = method.getModifiers
+    if (
+      !Modifier.isPublic(modifiers) || !Modifier.isStatic(modifiers) ||
+      method.getParameterCount != 0 ||
+      !classOf[ScalaJsonCodec[_]].isAssignableFrom(method.getReturnType)
+    ) return null
+    try {
+      val codec = method.invoke(null)
+      if (codec == null)
+        throw new ForyJsonException(s"Derived Scala JSON codec is null for ${rootType.getName}")
+      codec.asInstanceOf[JsonCodecFactory]
+    } catch {
+      case error: ReflectiveOperationException =>
+        throw new ForyJsonException(
+          s"Cannot load derived Scala JSON codec for ${rootType.getName}",
+          error
+        )
+    }
+  }
+}
diff --git a/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaJsonCodecMacros.scala b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaJsonCodecMacros.scala
new file mode 100644
index 000000000..2e73d60c8
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaJsonCodecMacros.scala
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import org.apache.fory.json.scala.ScalaJsonCodec
+
+import scala.quoted.*
+
+private[scala] object ScalaJsonCodecMacros {
+  def derive[T: Type](using quotes: Quotes): Expr[ScalaJsonCodec[T]] = {
+    import quotes.reflect.*
+
+    val root = TypeRepr.of[T].dealias.typeSymbol
+    if (!root.flags.is(Flags.Enum))
+      report.errorAndAbort(s"${root.fullName} is not a Scala 3 enum")
+
+    val cases = root.children.filter(_.flags.is(Flags.Case))
+    if (cases.isEmpty)
+      report.errorAndAbort(s"${root.fullName} has no closed enum cases")
+
+    val rootClass =
+      Literal(ClassOfConstant(TypeRepr.of[T].dealias)).asExprOf[Class[?]]
+    val caseExpressions = cases.map { child =>
+      if (child.primaryConstructor == Symbol.noSymbol) {
+        val value = Select.unique(Ref(root.companionModule), child.name).asExpr
+        val singleton = '{ $value.asInstanceOf[AnyRef] }
+        ('{ $singleton.getClass }, singleton)
+      } else {
+        (Literal(ClassOfConstant(child.typeRef)).asExprOf[Class[?]], '{ null })
+      }
+    }
+    val classExpressions = caseExpressions.map(_._1)
+    val singletonExpressions = caseExpressions.map(_._2)
+    val nameExpressions = cases.map(child => Expr(child.name.stripSuffix("$")))
+
+    '{
+      new DerivedScalaJsonCodec[T](
+        $rootClass.asInstanceOf[Class[T]],
+        Array[Class[_]](${ Varargs(classExpressions) }*),
+        Array[String](${ Varargs(nameExpressions) }*),
+        Array[AnyRef](${ Varargs(singletonExpressions) }*)
+      )
+    }
+  }
+}
diff --git a/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala
new file mode 100644
index 000000000..a6326d6ed
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala-3/org/apache/fory/json/scala/internal/ScalaTypeRefMacros.scala
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import scala.quoted.*
+
+private[scala] object ScalaTypeRefMacros {
+  def create[T: Type](using Quotes): Expr[org.apache.fory.reflect.TypeRef[T]] = {
+    import quotes.reflect.*
+
+    def typeRefExpr(tpe: TypeRepr): Expr[org.apache.fory.reflect.TypeRef[?]] = {
+      val normalized = tpe.dealias
+      val raw = normalized.classSymbol.getOrElse {
+        report.errorAndAbort(s"${normalized.show} has no runtime class")
+      }
+      val rawClass = Literal(ClassOfConstant(normalized)).asExprOf[Class[?]]
+      normalized match {
+        case AppliedType(_, arguments) if arguments.nonEmpty =>
+          val childRefs = arguments.map(typeRefExpr)
+          '{
+            org.apache.fory.reflect.TypeRef.ofDeclaredTypeArguments(
+              $rawClass.asInstanceOf[Class[Any]],
+              null,
+              java.util.Arrays.asList[org.apache.fory.reflect.TypeRef[_]](${ Varargs(childRefs) }*),
+              null
+            )
+          }
+        case _ => '{ org.apache.fory.reflect.TypeRef.of($rawClass) }
+      }
+    }
+
+    val result = typeRefExpr(TypeRepr.of[T])
+    '{ $result.asInstanceOf[org.apache.fory.reflect.TypeRef[T]] }
+  }
+}
diff --git a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ForyJsonScala.scala
similarity index 56%
copy from scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
copy to scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ForyJsonScala.scala
index 142362da2..2c53b403b 100644
--- a/scala/src/test/java/org/apache/fory/util/ConstructorDefaultLikeJavaClass.java
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ForyJsonScala.scala
@@ -17,24 +17,18 @@
  * under the License.
  */
 
-package org.apache.fory.util;
+package org.apache.fory.json.scala
 
-public class ConstructorDefaultLikeJavaClass {
-  private final String id;
+import org.apache.fory.json.{ForyJson, ForyJsonBuilder, ForyJsonModule, ModuleContext}
+import org.apache.fory.json.scala.internal.{ScalaTypeCodecFactory, ScalaUnitCodec}
 
-  public ConstructorDefaultLikeJavaClass(String id) {
-    this.id = id;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  private static String $lessinit$greater$default$1() {
-    return "default-id";
-  }
+/** Entry point for Scala-aware Fory JSON runtimes. */
+object ForyJsonScala extends ForyJsonModule {
+  /** Returns a Fory JSON builder with the Scala module installed. */
+  def builder(): ForyJsonBuilder = ForyJson.builder().withModule(this)
 
-  private static String $lessinit$greater$default$2() {
-    return "out-of-range";
+  override def install(context: ModuleContext): Unit = {
+    context.registerCodec(classOf[scala.runtime.BoxedUnit], ScalaUnitCodec)
+    context.registerCodecFactory(ScalaTypeCodecFactory)
   }
 }
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ScalaEnumerationCodec.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ScalaEnumerationCodec.scala
new file mode 100644
index 000000000..70f57771e
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/ScalaEnumerationCodec.scala
@@ -0,0 +1,67 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala
+
+import java.util.HashMap
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.codec.{AbstractJsonValueCodec, MapKeyCodec}
+import org.apache.fory.json.reader.JsonReader
+import org.apache.fory.json.writer.JsonWriter
+
+/** JSON codec bound to one Scala 2 `Enumeration` owner. */
+abstract class ScalaEnumerationCodec(val enumeration: Enumeration)
+    extends AbstractJsonValueCodec[Enumeration#Value]
+    with MapKeyCodec {
+  if (enumeration == null) throw new NullPointerException("enumeration")
+
+  private val byName = {
+    val values = new HashMap[String, Enumeration#Value](enumeration.values.size * 2)
+    val iterator = enumeration.values.iterator
+    while (iterator.hasNext) {
+      val value = iterator.next()
+      val previous = values.put(value.toString, value)
+      if (previous != null)
+        throw new IllegalArgumentException(s"Duplicate Scala Enumeration name ${value.toString}")
+    }
+    values
+  }
+
+  override final def write(writer: JsonWriter, value: Enumeration#Value): Unit = {
+    if (value == null) writer.writeNull()
+    else writer.writeString(toName(value))
+  }
+
+  override final def read(reader: JsonReader): Enumeration#Value = {
+    if (reader.tryReadNullToken()) return null
+    fromName(reader.readString()).asInstanceOf[Enumeration#Value]
+  }
+
+  override final def toName(key: Object): String = key match {
+    case value: Enumeration#Value if byName.get(value.toString) eq value => value.toString
+    case _ => throw new ForyJsonException("Scala Enumeration value belongs to a different owner")
+  }
+
+  override final def fromName(name: String): Object = {
+    val value = byName.get(name)
+    if (value == null) throw new ForyJsonException(s"Unknown Scala Enumeration value $name")
+    value
+  }
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaAlgebraicCodecs.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaAlgebraicCodecs.scala
new file mode 100644
index 000000000..d6ddd0655
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaAlgebraicCodecs.scala
@@ -0,0 +1,239 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.annotation.JsonCodec
+import org.apache.fory.json.codec.CompositeJsonCodec
+import org.apache.fory.json.reader.{Latin1JsonReader, Utf16JsonReader, Utf8JsonReader}
+import org.apache.fory.json.resolver.{JsonTypeInfo, JsonTypeResolver}
+import org.apache.fory.json.writer.{StringJsonWriter, Utf8JsonWriter}
+import org.apache.fory.reflect.TypeRef
+import org.apache.fory.serializer.GraphMemoryEstimates
+
+private[scala] final class ScalaOptionCodec(someOnly: Boolean)
+    extends CompositeJsonCodec[Option[Any]] {
+  private var elementInfo: JsonTypeInfo = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    val arguments = ScalaTypeSupport.runtimeArguments(
+      typeRef,
+      1,
+      if (someOnly) "Some" else "Option",
+      resolver.resolvingRuntimeType()
+    )
+    val elementType = arguments(0)
+    elementInfo = resolver.getTypeInfo(elementType, ScalaTypeSupport.rawType(elementType))
+  }
+
+  override def resolveTypes(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    ScalaTypeSupport.requireContentCodec(childCodecs, if (someOnly) "Some" else "Option")
+    val arguments = ScalaTypeSupport.arguments(typeRef, 1, if (someOnly) "Some" else "Option")
+    val elementType = arguments(0)
+    elementInfo = resolver.getTypeInfo(
+      elementType,
+      ScalaTypeSupport.rawType(elementType),
+      childCodecs.contentCodec()
+    )
+  }
+
+  override def writeString(writer: StringJsonWriter, value: Option[Any]): Unit = {
+    if (value == null || value.isEmpty) writer.writeNull()
+    else elementInfo.stringWriter().writeString(writer, value.get)
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: Option[Any]): Unit = {
+    if (value == null || value.isEmpty) writer.writeNull()
+    else elementInfo.utf8Writer().writeUtf8(writer, value.get)
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): Option[Any] = {
+    if (reader.tryReadNullToken()) readNull()
+    else newSome(reader, elementInfo.latin1Reader().readLatin1(reader))
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): Option[Any] = {
+    if (reader.tryReadNullToken()) readNull()
+    else newSome(reader, elementInfo.utf16Reader().readUtf16(reader))
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): Option[Any] = {
+    if (reader.tryReadNullToken()) readNull()
+    else newSome(reader, elementInfo.utf8Reader().readUtf8(reader))
+  }
+
+  private def readNull(): Option[Any] = {
+    if (someOnly) throw new ForyJsonException("JSON null cannot be decoded as scala.Some")
+    None
+  }
+
+  private def newSome(reader: org.apache.fory.json.reader.JsonReader, value: Any): Option[Any] = {
+    reader.reserveGraphMemory(ScalaOptionCodec.SomeOwnerBytes)
+    Some(value)
+  }
+}
+
+private[scala] object ScalaOptionCodec {
+  private val SomeOwnerBytes = GraphMemoryEstimates.shallowObjectBytes(classOf[Some[_]])
+}
+
+private[scala] object ScalaNoneCodec extends org.apache.fory.json.codec.AbstractJsonValueCodec[None.type] {
+  override def write(writer: org.apache.fory.json.writer.JsonWriter, value: None.type): Unit = {
+    if (value != null && (value ne None))
+      throw new ForyJsonException("Expected scala.None")
+    writer.writeNull()
+  }
+
+  override def read(reader: org.apache.fory.json.reader.JsonReader): None.type = {
+    if (!reader.tryReadNullToken())
+      throw new ForyJsonException("scala.None requires JSON null")
+    None
+  }
+}
+
+private[scala] final class ScalaEitherCodec(branch: Int)
+    extends CompositeJsonCodec[Either[Any, Any]] {
+  private var leftInfo: JsonTypeInfo = _
+  private var rightInfo: JsonTypeInfo = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    val arguments = ScalaTypeSupport.runtimeArguments(
+      typeRef,
+      2,
+      branch match {
+        case 1 => "Left"
+        case 2 => "Right"
+        case _ => "Either"
+      },
+      resolver.resolvingRuntimeType()
+    )
+    leftInfo = resolver.getTypeInfo(arguments(0), ScalaTypeSupport.rawType(arguments(0)))
+    rightInfo = resolver.getTypeInfo(arguments(1), ScalaTypeSupport.rawType(arguments(1)))
+  }
+
+  override def writeString(writer: StringJsonWriter, value: Either[Any, Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    writer.writeObjectStart()
+    value match {
+      case Left(left) =>
+        writer.writeFieldName("left")
+        leftInfo.stringWriter().writeString(writer, left)
+      case Right(right) =>
+        writer.writeFieldName("right")
+        rightInfo.stringWriter().writeString(writer, right)
+    }
+    writer.writeObjectEnd()
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: Either[Any, Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    writer.writeObjectStart()
+    value match {
+      case Left(left) =>
+        writer.writeFieldName("left")
+        leftInfo.utf8Writer().writeUtf8(writer, left)
+      case Right(right) =>
+        writer.writeFieldName("right")
+        rightInfo.utf8Writer().writeUtf8(writer, right)
+    }
+    writer.writeObjectEnd()
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): Either[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    if (reader.consumeNextToken('}')) throw invalid()
+    val name = reader.readFieldName()
+    reader.expectNextToken(':')
+    val value =
+      if (name == "left") newLeft(reader, leftInfo.latin1Reader().readLatin1(reader))
+      else if (name == "right") newRight(reader, rightInfo.latin1Reader().readLatin1(reader))
+      else throw invalid()
+    if (reader.consumeNextCommaOrEndObject()) throw invalid()
+    reader.exitDepth()
+    validateBranch(value)
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): Either[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    if (reader.consumeNextToken('}')) throw invalid()
+    val name = reader.readFieldName()
+    reader.expectNextToken(':')
+    val value =
+      if (name == "left") newLeft(reader, leftInfo.utf16Reader().readUtf16(reader))
+      else if (name == "right") newRight(reader, rightInfo.utf16Reader().readUtf16(reader))
+      else throw invalid()
+    if (reader.consumeNextCommaOrEndObject()) throw invalid()
+    reader.exitDepth()
+    validateBranch(value)
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): Either[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    if (reader.consumeNextToken('}')) throw invalid()
+    val name = reader.readFieldName()
+    reader.expectNextToken(':')
+    val value =
+      if (name == "left") newLeft(reader, leftInfo.utf8Reader().readUtf8(reader))
+      else if (name == "right") newRight(reader, rightInfo.utf8Reader().readUtf8(reader))
+      else throw invalid()
+    if (reader.consumeNextCommaOrEndObject()) throw invalid()
+    reader.exitDepth()
+    validateBranch(value)
+  }
+
+  private def validateBranch(value: Either[Any, Any]): Either[Any, Any] = {
+    if (branch == 1 && value.isRight || branch == 2 && value.isLeft) throw invalid()
+    value
+  }
+
+  private def newLeft(reader: org.apache.fory.json.reader.JsonReader, value: Any): Left[Any, Any] = {
+    reader.reserveGraphMemory(ScalaEitherCodec.LeftOwnerBytes)
+    Left(value)
+  }
+
+  private def newRight(reader: org.apache.fory.json.reader.JsonReader, value: Any): Right[Any, Any] = {
+    reader.reserveGraphMemory(ScalaEitherCodec.RightOwnerBytes)
+    Right(value)
+  }
+
+  private def invalid(): ForyJsonException =
+    new ForyJsonException("Scala Either JSON must contain exactly one left or right member")
+}
+
+private[scala] object ScalaEitherCodec {
+  private val LeftOwnerBytes = GraphMemoryEstimates.shallowObjectBytes(classOf[Left[_, _]])
+  private val RightOwnerBytes = GraphMemoryEstimates.shallowObjectBytes(classOf[Right[_, _]])
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaBitSetCodec.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaBitSetCodec.scala
new file mode 100644
index 000000000..ecc4d3d4c
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaBitSetCodec.scala
@@ -0,0 +1,102 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.codec.AbstractJsonValueCodec
+import org.apache.fory.json.reader.JsonReader
+import org.apache.fory.json.writer.JsonWriter
+import org.apache.fory.serializer.GraphMemoryEstimates
+
+private[scala] final class ScalaBitSetCodec(mutableResult: Boolean)
+    extends AbstractJsonValueCodec[scala.collection.BitSet] {
+  private val OwnerBytes = GraphMemoryEstimates.shallowObjectBytes(
+    if (mutableResult) classOf[scala.collection.mutable.BitSet]
+    else classOf[scala.collection.immutable.BitSet]
+  )
+  private val ArrayHeaderBytes = GraphMemoryEstimates.objectArrayBytes()
+
+  override def write(writer: JsonWriter, value: scala.collection.BitSet): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    writer.writeArrayStart()
+    val iterator = value.iterator
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      writer.writeInt(iterator.next())
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def read(reader: JsonReader): scala.collection.BitSet = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    val inputStart = reader.position()
+    reader.expectNextToken('[')
+    var words = Array.emptyLongArray
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        val bit = reader.readInt()
+        if (bit < 0) throw invalidBit(bit)
+        val requiredWords = (bit >>> 6) + 1
+        if (requiredWords > words.length) {
+          words = grow(reader, words, requiredWords, inputStart)
+        }
+        words(bit >>> 6) |= 1L << bit
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    reader.reserveGraphMemory(OwnerBytes)
+    val result: scala.collection.BitSet =
+      if (mutableResult)
+        scala.collection.mutable.BitSet.fromBitMaskNoCopy(words): scala.collection.BitSet
+      else scala.collection.immutable.BitSet.fromBitMaskNoCopy(words): scala.collection.BitSet
+    reader.exitDepth()
+    result
+  }
+
+  private def grow(
+      reader: JsonReader,
+      source: Array[Long],
+      required: Int,
+      inputStart: Int
+  ): Array[Long] = {
+    var capacity = if (source.length == 0) 1 else source.length
+    while (capacity < required) {
+      val doubled = capacity.toLong << 1
+      capacity = if (doubled >= required && doubled <= Int.MaxValue) doubled.toInt else required
+    }
+    // One readable input byte per retained word is the same proportional-input lower bound used
+    // by count-driven containers. A compact high bit index must not allocate a dense backing array.
+    reader.checkReadableBytesFrom(inputStart, capacity)
+    val addedWords = capacity - source.length
+    val bytes = Math.multiplyExact(addedWords, java.lang.Long.BYTES)
+    reader.reserveGraphMemory(if (source.length == 0) Math.addExact(ArrayHeaderBytes, bytes) else bytes)
+    java.util.Arrays.copyOf(source, capacity)
+  }
+
+  private def invalidBit(value: Int): ForyJsonException =
+    new ForyJsonException(s"Scala BitSet index must be non-negative: $value")
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaCollectionCodecs.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaCollectionCodecs.scala
new file mode 100644
index 000000000..2e071f5b4
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaCollectionCodecs.scala
@@ -0,0 +1,661 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.annotation.JsonCodec
+import org.apache.fory.json.codec.{CompositeJsonCodec, MapKeyCodec}
+import org.apache.fory.json.reader.{JsonReader, Latin1JsonReader, Utf16JsonReader, Utf8JsonReader}
+import org.apache.fory.json.resolver.{JsonTypeInfo, JsonTypeResolver}
+import org.apache.fory.json.writer.{StringJsonWriter, Utf8JsonWriter}
+import org.apache.fory.reflect.TypeRef
+import org.apache.fory.serializer.GraphMemoryEstimates
+
+import scala.reflect.ClassTag
+
+private[scala] final class ScalaListCodec(nonEmptyOnly: Boolean, nilOnly: Boolean)
+    extends CompositeJsonCodec[List[Any]] {
+  private var elementInfo: JsonTypeInfo = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    if (nilOnly) {
+      elementInfo = resolver.getTypeInfo(classOf[Object], classOf[Object])
+    } else {
+      val arguments = ScalaTypeSupport.runtimeArguments(
+        typeRef,
+        1,
+        "List",
+        resolver.resolvingRuntimeType()
+      )
+      elementInfo = resolver.getTypeInfo(arguments(0), ScalaTypeSupport.rawType(arguments(0)))
+    }
+  }
+
+  override def resolveTypes(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    ScalaTypeSupport.requireElementCodec(childCodecs, "List")
+    val arguments = ScalaTypeSupport.arguments(typeRef, 1, "List")
+    elementInfo = resolver.getTypeInfo(
+      arguments(0),
+      ScalaTypeSupport.rawType(arguments(0)),
+      childCodecs.elementCodec()
+    )
+  }
+
+  override def writeString(writer: StringJsonWriter, value: List[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = elementInfo.stringWriter()
+    writer.writeArrayStart()
+    var current = value
+    var index = 0
+    while (current.nonEmpty) {
+      writer.writeComma(index)
+      codec.writeString(writer, current.head)
+      current = current.tail
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: List[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = elementInfo.utf8Writer()
+    writer.writeArrayStart()
+    var current = value
+    var index = 0
+    while (current.nonEmpty) {
+      writer.writeComma(index)
+      codec.writeUtf8(writer, current.head)
+      current = current.tail
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): List[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    val builder = List.newBuilder[Any]
+    val codec = elementInfo.latin1Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        reserveBatch(reader, size)
+        builder += codec.readLatin1(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    reserveTail(reader, size)
+    reader.exitDepth()
+    finish(builder.result(), size)
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): List[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    val builder = List.newBuilder[Any]
+    val codec = elementInfo.utf16Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        reserveBatch(reader, size)
+        builder += codec.readUtf16(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    reserveTail(reader, size)
+    reader.exitDepth()
+    finish(builder.result(), size)
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): List[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    val builder = List.newBuilder[Any]
+    val codec = elementInfo.utf8Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        reserveBatch(reader, size)
+        builder += codec.readUtf8(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    reserveTail(reader, size)
+    reader.exitDepth()
+    finish(builder.result(), size)
+  }
+
+  private def finish(value: List[Any], size: Int): List[Any] = {
+    if (nilOnly && size != 0) throw new ForyJsonException("scala.Nil requires an empty JSON array")
+    if (nonEmptyOnly && size == 0)
+      throw new ForyJsonException("scala.:: requires a non-empty JSON array")
+    value
+  }
+
+  private def reserveBatch(reader: JsonReader, size: Int): Unit = {
+    if ((size & ScalaCollectionCodecs.BatchMask) == ScalaCollectionCodecs.BatchMask) {
+      reader.reserveGraphMemory(ScalaCollectionCodecs.ListBatchBytes)
+    }
+  }
+
+  private def reserveTail(reader: JsonReader, size: Int): Unit = {
+    val tail = size & ScalaCollectionCodecs.BatchMask
+    if (tail != 0) reader.reserveGraphMemory(tail * ScalaCollectionCodecs.ListNodeBytes)
+  }
+}
+
+private[scala] final class ScalaIterableCodec(kind: Int, ownerBytes: Int)
+    extends CompositeJsonCodec[scala.collection.Iterable[Any]] {
+  private val resultOwnerBytes =
+    if (kind == ScalaCollectionCodecs.ListKind) 0 else ownerBytes
+  private val retainedElementBytes =
+    if (kind == ScalaCollectionCodecs.ListKind) ScalaCollectionCodecs.ListNodeBytes
+    else ScalaCollectionCodecs.ReferenceBytes
+  private var elementInfo: JsonTypeInfo = _
+  private var elementClassTag: ClassTag[Any] = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    val arguments = ScalaTypeSupport.runtimeArguments(
+      typeRef,
+      1,
+      "Scala collection",
+      resolver.resolvingRuntimeType()
+    )
+    elementInfo = resolver.getTypeInfo(arguments(0), ScalaTypeSupport.rawType(arguments(0)))
+    if (
+      kind == ScalaCollectionCodecs.ImmutableArraySeqKind ||
+      kind == ScalaCollectionCodecs.MutableArraySeqKind
+    ) elementClassTag = ScalaTypeSupport.classTag(ScalaTypeSupport.rawType(arguments(0)))
+  }
+
+  override def resolveTypes(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    ScalaTypeSupport.requireElementCodec(childCodecs, "Scala collection")
+    val arguments = ScalaTypeSupport.arguments(typeRef, 1, "Scala collection")
+    val rawType = ScalaTypeSupport.rawType(arguments(0))
+    elementInfo = resolver.getTypeInfo(arguments(0), rawType, childCodecs.elementCodec())
+    if (
+      kind == ScalaCollectionCodecs.ImmutableArraySeqKind ||
+      kind == ScalaCollectionCodecs.MutableArraySeqKind
+    ) elementClassTag = ScalaTypeSupport.classTag(rawType)
+  }
+
+  override def writeString(writer: StringJsonWriter, value: scala.collection.Iterable[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = elementInfo.stringWriter()
+    val iterator = value.iterator
+    writer.writeArrayStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      codec.writeString(writer, iterator.next())
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: scala.collection.Iterable[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = elementInfo.utf8Writer()
+    val iterator = value.iterator
+    writer.writeArrayStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      codec.writeUtf8(writer, iterator.next())
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): scala.collection.Iterable[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    reader.reserveGraphMemory(resultOwnerBytes)
+    val builder = newBuilder()
+    val codec = elementInfo.latin1Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveElements(reader, size, retainedElementBytes)
+        builder += codec.readLatin1(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    ScalaCollectionCodecs.reserveElementTail(reader, size, retainedElementBytes)
+    val result = builder.result().asInstanceOf[scala.collection.Iterable[Any]]
+    reader.exitDepth()
+    result
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): scala.collection.Iterable[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    reader.reserveGraphMemory(resultOwnerBytes)
+    val builder = newBuilder()
+    val codec = elementInfo.utf16Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveElements(reader, size, retainedElementBytes)
+        builder += codec.readUtf16(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    ScalaCollectionCodecs.reserveElementTail(reader, size, retainedElementBytes)
+    val result = builder.result().asInstanceOf[scala.collection.Iterable[Any]]
+    reader.exitDepth()
+    result
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): scala.collection.Iterable[Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    reader.reserveGraphMemory(resultOwnerBytes)
+    val builder = newBuilder()
+    val codec = elementInfo.utf8Reader()
+    var size = 0
+    if (!reader.consumeNextToken(']')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveElements(reader, size, retainedElementBytes)
+        builder += codec.readUtf8(reader)
+        size += 1
+        more = reader.consumeNextCommaOrEndArray()
+      }
+    }
+    ScalaCollectionCodecs.reserveElementTail(reader, size, retainedElementBytes)
+    val result = builder.result().asInstanceOf[scala.collection.Iterable[Any]]
+    reader.exitDepth()
+    result
+  }
+
+  private def newBuilder(): scala.collection.mutable.Builder[Any, _] = kind match {
+    case ScalaCollectionCodecs.VectorKind => Vector.newBuilder[Any]
+    case ScalaCollectionCodecs.ImmutableQueueKind => scala.collection.immutable.Queue.newBuilder[Any]
+    case ScalaCollectionCodecs.ImmutableArraySeqKind =>
+      scala.collection.immutable.ArraySeq.newBuilder[Any](elementClassTag)
+    case ScalaCollectionCodecs.MutableArrayBufferKind =>
+      scala.collection.mutable.ArrayBuffer.newBuilder[Any]
+    case ScalaCollectionCodecs.MutableListBufferKind =>
+      scala.collection.mutable.ListBuffer.newBuilder[Any]
+    case ScalaCollectionCodecs.MutableArraySeqKind =>
+      scala.collection.mutable.ArraySeq.newBuilder[Any](elementClassTag)
+    case ScalaCollectionCodecs.MutableArrayDequeKind =>
+      scala.collection.mutable.ArrayDeque.newBuilder[Any]
+    case ScalaCollectionCodecs.MutableQueueKind => scala.collection.mutable.Queue.newBuilder[Any]
+    case ScalaCollectionCodecs.ImmutableHashSetKind =>
+      scala.collection.immutable.HashSet.newBuilder[Any]
+    case ScalaCollectionCodecs.ImmutableListSetKind =>
+      scala.collection.immutable.ListSet.newBuilder[Any]
+    case ScalaCollectionCodecs.MutableHashSetKind =>
+      scala.collection.mutable.HashSet.newBuilder[Any]
+    case ScalaCollectionCodecs.MutableLinkedHashSetKind =>
+      scala.collection.mutable.LinkedHashSet.newBuilder[Any]
+    case _ => List.newBuilder[Any]
+  }
+}
+
+private[scala] final class ScalaMapCodec(kind: Int, ownerBytes: Int)
+    extends CompositeJsonCodec[scala.collection.Map[Any, Any]] {
+  private var keyCodec: MapKeyCodec = _
+  private var valueInfo: JsonTypeInfo = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    val specializedKey = ScalaCollectionCodecs.specializedMapKey(kind)
+    val arguments = ScalaTypeSupport.runtimeArguments(
+      typeRef,
+      if (specializedKey == null) 2 else 1,
+      "Scala Map",
+      resolver.resolvingRuntimeType()
+    )
+    val keyRawType = if (specializedKey == null) ScalaTypeSupport.rawType(arguments(0)) else specializedKey
+    keyCodec = resolver.getMapKeyCodec(keyRawType)
+    val valueType = arguments(if (specializedKey == null) 1 else 0)
+    valueInfo = resolver.getTypeInfo(valueType, ScalaTypeSupport.rawType(valueType))
+  }
+
+  override def resolveTypes(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    ScalaTypeSupport.requireMapCodecs(childCodecs)
+    val specializedKey = ScalaCollectionCodecs.specializedMapKey(kind)
+    val arguments = ScalaTypeSupport.arguments(
+      typeRef,
+      if (specializedKey == null) 2 else 1,
+      "Scala Map"
+    )
+    val keyType = if (specializedKey == null) arguments(0) else specializedKey
+    val keyRawType = ScalaTypeSupport.rawType(keyType)
+    keyCodec =
+      if (childCodecs.keyCodec() == classOf[JsonCodec.NoMapKeyCodec]) resolver.getMapKeyCodec(keyRawType)
+      else resolver.getMapKeyCodec(keyRawType, childCodecs.keyCodec())
+    val valueType = arguments(if (specializedKey == null) 1 else 0)
+    val valueRawType = ScalaTypeSupport.rawType(valueType)
+    valueInfo =
+      if (childCodecs.valueCodec() == classOf[JsonCodec.NoJsonValueCodec])
+        resolver.getTypeInfo(valueType, valueRawType)
+      else resolver.getTypeInfo(valueType, valueRawType, childCodecs.valueCodec())
+  }
+
+  override def writeString(writer: StringJsonWriter, value: scala.collection.Map[Any, Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = valueInfo.stringWriter()
+    val iterator = value.iterator
+    writer.writeObjectStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      val entry = iterator.next()
+      if (entry._1 == null) throw new ForyJsonException("JSON map key cannot be null")
+      keyCodec.writeName(writer, entry._1)
+      codec.writeString(writer, entry._2)
+      index += 1
+    }
+    writer.writeObjectEnd()
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: scala.collection.Map[Any, Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    ScalaCollectionCodecs.requireSupportedRuntime(value.getClass)
+    val codec = valueInfo.utf8Writer()
+    val iterator = value.iterator
+    writer.writeObjectStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      val entry = iterator.next()
+      if (entry._1 == null) throw new ForyJsonException("JSON map key cannot be null")
+      keyCodec.writeName(writer, entry._1)
+      codec.writeUtf8(writer, entry._2)
+      index += 1
+    }
+    writer.writeObjectEnd()
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): scala.collection.Map[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    reader.reserveGraphMemory(ownerBytes)
+    val builder = newBuilder()
+    val codec = valueInfo.latin1Reader()
+    var size = 0
+    if (!reader.consumeNextToken('}')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveMapEntries(reader, size)
+        val key = keyCodec.readName(reader)
+        reader.expectNextToken(':')
+        builder += ((key, codec.readLatin1(reader)))
+        size += 1
+        more = reader.consumeNextCommaOrEndObject()
+      }
+    }
+    finish(reader, builder, size)
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): scala.collection.Map[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    reader.reserveGraphMemory(ownerBytes)
+    val builder = newBuilder()
+    val codec = valueInfo.utf16Reader()
+    var size = 0
+    if (!reader.consumeNextToken('}')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveMapEntries(reader, size)
+        val key = keyCodec.readName(reader)
+        reader.expectNextToken(':')
+        builder += ((key, codec.readUtf16(reader)))
+        size += 1
+        more = reader.consumeNextCommaOrEndObject()
+      }
+    }
+    finish(reader, builder, size)
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): scala.collection.Map[Any, Any] = {
+    if (reader.tryReadNullToken()) return null
+    reader.enterDepth()
+    reader.expectNextToken('{')
+    reader.reserveGraphMemory(ownerBytes)
+    val builder = newBuilder()
+    val codec = valueInfo.utf8Reader()
+    var size = 0
+    if (!reader.consumeNextToken('}')) {
+      var more = true
+      while (more) {
+        ScalaCollectionCodecs.reserveMapEntries(reader, size)
+        val key = keyCodec.readName(reader)
+        reader.expectNextToken(':')
+        builder += ((key, codec.readUtf8(reader)))
+        size += 1
+        more = reader.consumeNextCommaOrEndObject()
+      }
+    }
+    finish(reader, builder, size)
+  }
+
+  private def newBuilder(): scala.collection.mutable.Builder[(Any, Any), _] = kind match {
+    case ScalaCollectionCodecs.ImmutableVectorMapKind =>
+      scala.collection.immutable.VectorMap.newBuilder[Any, Any]
+    case ScalaCollectionCodecs.ImmutableListMapKind =>
+      scala.collection.immutable.ListMap.newBuilder[Any, Any]
+    case ScalaCollectionCodecs.ImmutableIntMapKind =>
+      scala.collection.immutable.IntMap.newBuilder[Any].asInstanceOf[scala.collection.mutable.Builder[(Any, Any), _]]
+    case ScalaCollectionCodecs.ImmutableLongMapKind =>
+      scala.collection.immutable.LongMap.newBuilder[Any].asInstanceOf[scala.collection.mutable.Builder[(Any, Any), _]]
+    case ScalaCollectionCodecs.MutableHashMapKind =>
+      scala.collection.mutable.HashMap.newBuilder[Any, Any]
+    case ScalaCollectionCodecs.MutableLinkedHashMapKind =>
+      scala.collection.mutable.LinkedHashMap.newBuilder[Any, Any]
+    case ScalaCollectionCodecs.MutableAnyRefMapKind =>
+      scala.collection.mutable.AnyRefMap.newBuilder[AnyRef, Any]
+        .asInstanceOf[scala.collection.mutable.Builder[(Any, Any), _]]
+    case ScalaCollectionCodecs.MutableLongMapKind =>
+      scala.collection.mutable.LongMap.newBuilder[Any]
+        .asInstanceOf[scala.collection.mutable.Builder[(Any, Any), _]]
+    case _ => scala.collection.immutable.HashMap.newBuilder[Any, Any]
+  }
+
+  private def finish(
+      reader: JsonReader,
+      builder: scala.collection.mutable.Builder[(Any, Any), _],
+    size: Int
+  ): scala.collection.Map[Any, Any] = {
+    ScalaCollectionCodecs.reserveMapTail(reader, size)
+    val result = builder.result().asInstanceOf[scala.collection.Map[Any, Any]]
+    reader.exitDepth()
+    result
+  }
+}
+
+private[scala] object ScalaCollectionCodecs {
+  val ListKind = 0
+  val VectorKind = 1
+  val ImmutableQueueKind = 2
+  val ImmutableArraySeqKind = 3
+  val MutableArrayBufferKind = 4
+  val MutableListBufferKind = 5
+  val MutableArraySeqKind = 6
+  val MutableArrayDequeKind = 7
+  val MutableQueueKind = 8
+  val ImmutableHashSetKind = 9
+  val ImmutableListSetKind = 10
+  val MutableHashSetKind = 11
+  val MutableLinkedHashSetKind = 12
+
+  val ImmutableHashMapKind = 20
+  val ImmutableVectorMapKind = 21
+  val ImmutableListMapKind = 22
+  val ImmutableIntMapKind = 23
+  val ImmutableLongMapKind = 24
+  val MutableHashMapKind = 25
+  val MutableLinkedHashMapKind = 26
+  val MutableAnyRefMapKind = 27
+  val MutableLongMapKind = 28
+
+  def specializedMapKey(kind: Int): Class[_] = kind match {
+    case ImmutableIntMapKind  => java.lang.Integer.TYPE
+    case ImmutableLongMapKind => java.lang.Long.TYPE
+    case MutableLongMapKind   => java.lang.Long.TYPE
+    case _                    => null
+  }
+
+  val BatchSize = 1024
+  val BatchMask = BatchSize - 1
+  val ReferenceBytes = GraphMemoryEstimates.REFERENCE_BYTES
+  val ListNodeBytes = GraphMemoryEstimates.shallowObjectBytes(classOf[scala.collection.immutable.::[_]])
+  val ListBatchBytes = BatchSize * ListNodeBytes
+  private val MapEntryBytes = 2 * ReferenceBytes
+  private val MapBatchBytes = BatchSize * MapEntryBytes
+
+  private val RuntimeClasses = {
+    val classes = new java.util.IdentityHashMap[Class[_], java.lang.Boolean]()
+    def add(value: AnyRef): Unit = classes.put(value.getClass, java.lang.Boolean.TRUE)
+
+    add(Nil)
+    add(List(1))
+    add(Vector.empty)
+    add(Vector(1))
+    add(Vector.tabulate(33)(identity))
+    add(scala.collection.immutable.Queue.empty)
+    add(scala.collection.immutable.ArraySeq.empty[Any])
+    add(scala.collection.immutable.ArraySeq.empty[Int])
+    add(scala.collection.mutable.ArrayBuffer.empty)
+    add(scala.collection.mutable.ListBuffer.empty)
+    add(scala.collection.mutable.ArraySeq.empty[Any])
+    add(scala.collection.mutable.ArraySeq.empty[Int])
+    add(scala.collection.mutable.ArrayDeque.empty)
+    add(scala.collection.mutable.Queue.empty)
+    add(scala.collection.immutable.Set.empty)
+    add(scala.collection.immutable.Set(1))
+    add(scala.collection.immutable.Set(1, 2))
+    add(scala.collection.immutable.Set(1, 2, 3))
+    add(scala.collection.immutable.Set(1, 2, 3, 4))
+    add(scala.collection.immutable.HashSet(1, 2, 3, 4, 5))
+    add(scala.collection.immutable.ListSet.empty)
+    add(scala.collection.immutable.ListSet(1))
+    add(scala.collection.mutable.HashSet.empty)
+    add(scala.collection.mutable.LinkedHashSet.empty)
+    add(scala.collection.immutable.Map.empty)
+    add(scala.collection.immutable.Map(1 -> 1))
+    add(scala.collection.immutable.Map(1 -> 1, 2 -> 2))
+    add(scala.collection.immutable.Map(1 -> 1, 2 -> 2, 3 -> 3))
+    add(scala.collection.immutable.Map(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4))
+    add(scala.collection.immutable.HashMap(1 -> 1, 2 -> 2, 3 -> 3, 4 -> 4, 5 -> 5))
+    add(scala.collection.immutable.VectorMap.empty)
+    add(scala.collection.immutable.ListMap.empty)
+    add(scala.collection.immutable.IntMap.empty)
+    add(scala.collection.immutable.LongMap.empty)
+    add(scala.collection.mutable.HashMap.empty)
+    add(scala.collection.mutable.LinkedHashMap.empty)
+    add(scala.collection.mutable.AnyRefMap.empty)
+    add(scala.collection.mutable.LongMap.empty)
+    classes
+  }
+
+  def requireSupportedRuntime(rawType: Class[_]): Unit = {
+    if (!supportedRuntime(rawType))
+      throw new ForyJsonException(s"Unsupported Scala collection runtime type ${rawType.getName}")
+  }
+
+  def supportedRuntime(rawType: Class[_]): Boolean =
+    RuntimeClasses.containsKey(rawType) ||
+      classOf[List[_]].isAssignableFrom(rawType) ||
+      classOf[Vector[_]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.ArraySeq[_]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.HashSet[_]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.ListSet[_]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.HashMap[_, _]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.VectorMap[_, _]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.ListMap[_, _]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.IntMap[_]].isAssignableFrom(rawType) ||
+      classOf[scala.collection.immutable.LongMap[_]].isAssignableFrom(rawType)
+
+  def reserveElements(reader: JsonReader, size: Int, bytes: Int): Unit = {
+    if ((size & BatchMask) == BatchMask) reader.reserveGraphMemory(BatchSize * bytes)
+  }
+
+  def reserveElementTail(reader: JsonReader, size: Int, bytes: Int): Unit = {
+    val tail = size & BatchMask
+    if (tail != 0) reader.reserveGraphMemory(tail * bytes)
+  }
+
+  def reserveMapEntries(reader: JsonReader, size: Int): Unit = {
+    if ((size & BatchMask) == BatchMask) reader.reserveGraphMemory(MapBatchBytes)
+  }
+
+  def reserveMapTail(reader: JsonReader, size: Int): Unit = {
+    val tail = size & BatchMask
+    if (tail != 0) reader.reserveGraphMemory(tail * MapEntryBytes)
+  }
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaEnumCodec.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaEnumCodec.scala
new file mode 100644
index 000000000..6439924c1
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaEnumCodec.scala
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import java.lang.reflect.Modifier
+import java.util.{HashMap, IdentityHashMap}
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.codec.{AbstractJsonValueCodec, JsonValueCodec}
+import org.apache.fory.json.reader.JsonReader
+import org.apache.fory.json.writer.JsonWriter
+import org.apache.fory.reflect.TypeRef
+
+private[scala] object ScalaEnumCodec {
+  def familyRoot(typeClass: Class[_]): Class[_] = {
+    var current = typeClass
+    while (current != null) {
+      if (current.getInterfaces.exists(_.getName == "scala.reflect.Enum")) {
+        return current
+      }
+      current = current.getSuperclass
+    }
+    null
+  }
+
+  def enumRoot(typeClass: Class[_]): Class[_] = {
+    var current = familyRoot(typeClass)
+    while (current != null) {
+      if (current.getInterfaces.exists(_.getName == "scala.reflect.Enum")) {
+        try {
+          val values = current.getMethod("values")
+          if (
+            Modifier.isStatic(values.getModifiers) && values.getReturnType.isArray &&
+            values.getReturnType.getComponentType == current
+          ) return current
+        } catch { case _: NoSuchMethodException => () }
+      }
+      current = current.getSuperclass
+    }
+    null
+  }
+
+  def create(typeClass: Class[_], typeRef: TypeRef[_]): JsonValueCodec[_] = {
+    try {
+      val valuesMethod = typeClass.getMethod("values")
+      if (!Modifier.isPublic(valuesMethod.getModifiers) || !Modifier.isStatic(valuesMethod.getModifiers)) {
+        throw ScalaTypeSupport.unsupported(typeRef, "enum values method is not public")
+      }
+      val values = valuesMethod.invoke(null).asInstanceOf[Array[Object]]
+      new ScalaEnumCodec(typeClass, values)
+    } catch {
+      case error: ReflectiveOperationException =>
+        throw new ForyJsonException(s"Cannot resolve Scala enum ${typeClass.getName}", error)
+    }
+  }
+}
+
+private final class ScalaEnumCodec(typeClass: Class[_], values: Array[Object])
+    extends AbstractJsonValueCodec[Object] {
+  private val byName = new HashMap[String, Object](values.length * 2)
+  private val nameByValue = new IdentityHashMap[Object, String](values.length * 2)
+  values.foreach { value =>
+    if (!typeClass.isInstance(value))
+      throw new ForyJsonException(s"Scala enum value is not a ${typeClass.getName}")
+    // productPrefix is the compiler-owned case label. Cache it by enum identity so an application
+    // toString override cannot change the JSON schema or add work to the writer hot path.
+    val name = value.asInstanceOf[Product].productPrefix
+    if (byName.put(name, value) != null)
+      throw new ForyJsonException(s"Duplicate Scala enum name $name on ${typeClass.getName}")
+    nameByValue.put(value, name)
+  }
+
+  override def write(writer: JsonWriter, value: Object): Unit = {
+    if (value == null) writer.writeNull()
+    else {
+      val name = nameByValue.get(value)
+      if (name == null) throw new ForyJsonException(s"Expected Scala enum ${typeClass.getName}")
+      writer.writeString(name)
+    }
+  }
+
+  override def read(reader: JsonReader): Object = {
+    if (reader.tryReadNullToken()) return null
+    val name = reader.readString()
+    val value = byName.get(name)
+    if (value == null) throw new ForyJsonException(s"Unknown Scala enum value $name")
+    value
+  }
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaNumericRangeCodec.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaNumericRangeCodec.scala
new file mode 100644
index 000000000..e9373f85d
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaNumericRangeCodec.scala
@@ -0,0 +1,315 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.annotation.JsonCodec
+import org.apache.fory.json.codec.CompositeJsonCodec
+import org.apache.fory.json.reader.{JsonReader, Latin1JsonReader, Utf16JsonReader, Utf8JsonReader}
+import org.apache.fory.json.resolver.{JsonTypeInfo, JsonTypeResolver}
+import org.apache.fory.json.writer.{StringJsonWriter, Utf8JsonWriter}
+import org.apache.fory.reflect.TypeRef
+import org.apache.fory.serializer.GraphMemoryEstimates
+
+import scala.collection.immutable.NumericRange
+import scala.math.Integral
+
+private[scala] final class ScalaNumericRangeCodec(exclusive: Boolean)
+    extends CompositeJsonCodec[NumericRange[Any]] {
+  private val ownerBytes = GraphMemoryEstimates.shallowObjectBytes(
+    if (exclusive) classOf[NumericRange.Exclusive[_]] else classOf[NumericRange.Inclusive[_]]
+  )
+  private var elementInfo: JsonTypeInfo = _
+  private var arithmetic: RangeArithmetic = _
+
+  override def resolveTypes(typeRef: TypeRef[_], resolver: JsonTypeResolver): Unit = {
+    bind(typeRef, resolver, null)
+  }
+
+  override def resolveTypes(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    ScalaTypeSupport.requireElementCodec(childCodecs, "NumericRange")
+    bind(typeRef, resolver, childCodecs)
+  }
+
+  private def bind(
+      typeRef: TypeRef[_],
+      resolver: JsonTypeResolver,
+      childCodecs: JsonCodec
+  ): Unit = {
+    if (resolver.resolvingRuntimeType() && !typeRef.getType.isInstanceOf[java.lang.reflect.ParameterizedType]) {
+      arithmetic = null
+      elementInfo = resolver.getTypeInfo(classOf[Object], classOf[Object])
+      return
+    }
+    val arguments = ScalaTypeSupport.arguments(typeRef, 1, "NumericRange")
+    val elementType = arguments(0)
+    val rawType = ScalaTypeSupport.rawType(elementType)
+    arithmetic = RangeArithmetic.forType(rawType, typeRef)
+    elementInfo =
+      if (childCodecs == null) resolver.getTypeInfo(elementType, rawType)
+      else resolver.getTypeInfo(elementType, rawType, childCodecs.elementCodec())
+  }
+
+  override def writeString(writer: StringJsonWriter, value: NumericRange[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    val codec = elementInfo.stringWriter()
+    val iterator = value.iterator
+    writer.writeArrayStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      codec.writeString(writer, iterator.next())
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def writeUtf8(writer: Utf8JsonWriter, value: NumericRange[Any]): Unit = {
+    if (value == null) {
+      writer.writeNull()
+      return
+    }
+    val codec = elementInfo.utf8Writer()
+    val iterator = value.iterator
+    writer.writeArrayStart()
+    var index = 0
+    while (iterator.hasNext) {
+      writer.writeComma(index)
+      codec.writeUtf8(writer, iterator.next())
+      index += 1
+    }
+    writer.writeArrayEnd()
+  }
+
+  override def readLatin1(reader: Latin1JsonReader): NumericRange[Any] = {
+    if (reader.tryReadNullToken()) return null
+    requireArithmetic()
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    if (reader.consumeNextToken(']')) {
+      reader.reserveGraphMemory(ownerBytes)
+      val empty = arithmetic.empty(exclusive)
+      reader.exitDepth()
+      return empty
+    }
+    val codec = elementInfo.latin1Reader()
+    val first = codec.readLatin1(reader)
+    if (!reader.consumeNextCommaOrEndArray()) {
+      reader.reserveGraphMemory(ownerBytes)
+      val single = arithmetic.single(first, exclusive)
+      reader.exitDepth()
+      return single
+    }
+    var current = codec.readLatin1(reader)
+    val step = arithmetic.subtract(current, first)
+    if (arithmetic.isZero(step)) throw invalidRange()
+    while (reader.consumeNextCommaOrEndArray()) {
+      val next = codec.readLatin1(reader)
+      if (!arithmetic.equal(arithmetic.subtract(next, current), step)) throw invalidRange()
+      current = next
+    }
+    reader.reserveGraphMemory(ownerBytes)
+    val result = arithmetic.create(first, current, step, exclusive)
+    reader.exitDepth()
+    result
+  }
+
+  override def readUtf16(reader: Utf16JsonReader): NumericRange[Any] = {
+    if (reader.tryReadNullToken()) return null
+    requireArithmetic()
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    if (reader.consumeNextToken(']')) {
+      reader.reserveGraphMemory(ownerBytes)
+      val empty = arithmetic.empty(exclusive)
+      reader.exitDepth()
+      return empty
+    }
+    val codec = elementInfo.utf16Reader()
+    val first = codec.readUtf16(reader)
+    if (!reader.consumeNextCommaOrEndArray()) {
+      reader.reserveGraphMemory(ownerBytes)
+      val single = arithmetic.single(first, exclusive)
+      reader.exitDepth()
+      return single
+    }
+    var current = codec.readUtf16(reader)
+    val step = arithmetic.subtract(current, first)
+    if (arithmetic.isZero(step)) throw invalidRange()
+    while (reader.consumeNextCommaOrEndArray()) {
+      val next = codec.readUtf16(reader)
+      if (!arithmetic.equal(arithmetic.subtract(next, current), step)) throw invalidRange()
+      current = next
+    }
+    reader.reserveGraphMemory(ownerBytes)
+    val result = arithmetic.create(first, current, step, exclusive)
+    reader.exitDepth()
+    result
+  }
+
+  override def readUtf8(reader: Utf8JsonReader): NumericRange[Any] = {
+    if (reader.tryReadNullToken()) return null
+    requireArithmetic()
+    reader.enterDepth()
+    reader.expectNextToken('[')
+    if (reader.consumeNextToken(']')) {
+      reader.reserveGraphMemory(ownerBytes)
+      val empty = arithmetic.empty(exclusive)
+      reader.exitDepth()
+      return empty
+    }
+    val codec = elementInfo.utf8Reader()
+    val first = codec.readUtf8(reader)
+    if (!reader.consumeNextCommaOrEndArray()) {
+      reader.reserveGraphMemory(ownerBytes)
+      val single = arithmetic.single(first, exclusive)
+      reader.exitDepth()
+      return single
+    }
+    var current = codec.readUtf8(reader)
+    val step = arithmetic.subtract(current, first)
+    if (arithmetic.isZero(step)) throw invalidRange()
+    while (reader.consumeNextCommaOrEndArray()) {
+      val next = codec.readUtf8(reader)
+      if (!arithmetic.equal(arithmetic.subtract(next, current), step)) throw invalidRange()
+      current = next
+    }
+    reader.reserveGraphMemory(ownerBytes)
+    val result = arithmetic.create(first, current, step, exclusive)
+    reader.exitDepth()
+    result
+  }
+
+  private def requireArithmetic(): Unit = {
+    if (arithmetic == null)
+      throw new ForyJsonException("Raw NumericRange is write-only; decoding requires TypeRef[NumericRange[T]]")
+  }
+
+  private def invalidRange(): ForyJsonException =
+    new ForyJsonException("Scala NumericRange JSON must be a non-overflowing arithmetic progression")
+}
+
+private sealed abstract class RangeArithmetic(val integral: Integral[Any]) {
+  final def equal(left: Any, right: Any): Boolean = integral.equiv(left, right)
+  final def isZero(value: Any): Boolean = integral.equiv(value, integral.zero)
+  def subtract(left: Any, right: Any): Any
+  def add(left: Any, right: Any): Any
+
+  final def empty(exclusive: Boolean): NumericRange[Any] = {
+    if (exclusive) NumericRange(integral.zero, integral.zero, integral.one)(integral)
+    else NumericRange.inclusive(integral.one, integral.zero, integral.one)(integral)
+  }
+
+  final def single(value: Any, exclusive: Boolean): NumericRange[Any] = {
+    if (exclusive) NumericRange(value, add(value, integral.one), integral.one)(integral)
+    else NumericRange.inclusive(value, value, integral.one)(integral)
+  }
+
+  final def create(
+      first: Any,
+      last: Any,
+      step: Any,
+      exclusive: Boolean
+  ): NumericRange[Any] = {
+    if (exclusive) NumericRange(first, add(last, step), step)(integral)
+    else NumericRange.inclusive(first, last, step)(integral)
+  }
+}
+
+private object RangeArithmetic {
+  private object ByteArithmetic
+      extends RangeArithmetic(scala.math.Numeric.ByteIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any = checkedByte(left.asInstanceOf[Byte].toInt - right.asInstanceOf[Byte].toInt)
+    override def add(left: Any, right: Any): Any = checkedByte(left.asInstanceOf[Byte].toInt + right.asInstanceOf[Byte].toInt)
+  }
+
+  private object ShortArithmetic
+      extends RangeArithmetic(scala.math.Numeric.ShortIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any = checkedShort(left.asInstanceOf[Short].toInt - right.asInstanceOf[Short].toInt)
+    override def add(left: Any, right: Any): Any = checkedShort(left.asInstanceOf[Short].toInt + right.asInstanceOf[Short].toInt)
+  }
+
+  private object IntArithmetic
+      extends RangeArithmetic(scala.math.Numeric.IntIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any =
+      try Math.subtractExact(left.asInstanceOf[Int], right.asInstanceOf[Int])
+      catch { case _: ArithmeticException => throw invalid() }
+    override def add(left: Any, right: Any): Any =
+      try Math.addExact(left.asInstanceOf[Int], right.asInstanceOf[Int])
+      catch { case _: ArithmeticException => throw invalid() }
+  }
+
+  private object LongArithmetic
+      extends RangeArithmetic(scala.math.Numeric.LongIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any =
+      try Math.subtractExact(left.asInstanceOf[Long], right.asInstanceOf[Long])
+      catch { case _: ArithmeticException => throw invalid() }
+    override def add(left: Any, right: Any): Any =
+      try Math.addExact(left.asInstanceOf[Long], right.asInstanceOf[Long])
+      catch { case _: ArithmeticException => throw invalid() }
+  }
+
+  private object CharArithmetic
+      extends RangeArithmetic(scala.math.Numeric.CharIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any = checkedChar(left.asInstanceOf[Char].toInt - right.asInstanceOf[Char].toInt)
+    override def add(left: Any, right: Any): Any = checkedChar(left.asInstanceOf[Char].toInt + right.asInstanceOf[Char].toInt)
+  }
+
+  private object BigIntArithmetic
+      extends RangeArithmetic(scala.math.Numeric.BigIntIsIntegral.asInstanceOf[Integral[Any]]) {
+    override def subtract(left: Any, right: Any): Any = left.asInstanceOf[BigInt] - right.asInstanceOf[BigInt]
+    override def add(left: Any, right: Any): Any = left.asInstanceOf[BigInt] + right.asInstanceOf[BigInt]
+  }
+
+  def forType(rawType: Class[_], owner: TypeRef[_]): RangeArithmetic = {
+    if (rawType == java.lang.Byte.TYPE || rawType == classOf[java.lang.Byte]) ByteArithmetic
+    else if (rawType == java.lang.Short.TYPE || rawType == classOf[java.lang.Short]) ShortArithmetic
+    else if (rawType == java.lang.Integer.TYPE || rawType == classOf[java.lang.Integer]) IntArithmetic
+    else if (rawType == java.lang.Long.TYPE || rawType == classOf[java.lang.Long]) LongArithmetic
+    else if (rawType == java.lang.Character.TYPE || rawType == classOf[java.lang.Character]) CharArithmetic
+    else if (rawType == classOf[BigInt]) BigIntArithmetic
+    else throw ScalaTypeSupport.unsupported(owner, "NumericRange element type has no built-in Integral")
+  }
+
+  private def checkedByte(value: Int): Byte = {
+    if (value < Byte.MinValue || value > Byte.MaxValue) throw invalid()
+    value.toByte
+  }
+
+  private def checkedShort(value: Int): Short = {
+    if (value < Short.MinValue || value > Short.MaxValue) throw invalid()
+    value.toShort
+  }
+
+  private def checkedChar(value: Int): Char = {
+    if (value < Char.MinValue.toInt || value > Char.MaxValue.toInt) throw invalid()
+    value.toChar
+  }
+
+  private def invalid(): ForyJsonException =
+    new ForyJsonException("Scala NumericRange arithmetic overflow")
+}
diff --git a/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaObjectModels.scala b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaObjectModels.scala
new file mode 100644
index 000000000..45b57d0f0
--- /dev/null
+++ b/scala/fory-json-scala/src/main/scala/org/apache/fory/json/scala/internal/ScalaObjectModels.scala
@@ -0,0 +1,253 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.fory.json.scala.internal
+
+import java.lang.reflect.{Constructor, Field, Method, Modifier}
+
+import org.apache.fory.json.ForyJsonException
+import org.apache.fory.json.codec.{AbstractJsonValueCodec, JsonObjectModel, JsonValueCodec}
+import org.apache.fory.json.reader.JsonReader
+import org.apache.fory.json.resolver.JsonTypeResolver
+import org.apache.fory.json.writer.JsonWriter
+import org.apache.fory.reflect.TypeRef
+
+private[scala] object ScalaObjectModels {
+  def isCaseClass(typeClass: Class[_]): Boolean = {
+    if (!classOf[Product].isAssignableFrom(typeClass) || typeClass.getName.startsWith("scala.Tuple")) {
+      return false
+    }
+    findPrimaryConstructor(typeClass) != null
+  }
+
+  def caseClassCodec(typeRef: TypeRef[_], resolver: JsonTypeResolver): JsonValueCodec[_] = {
+    val typeClass = typeRef.getRawType
+    val constructor = findPrimaryConstructor(typeClass)
+    if (constructor == null) {
+      throw ScalaTypeSupport.unsupported(typeRef, "case class has no supported public primary constructor")
+    }
+    val parameterTypes = constructor.getParameterTypes
+    val names = constructor.getParameters.map(_.getName)
+    val accessors = new Array[Method](names.length)
+    var index = 0
+    while (index < names.length) {
+      val accessor = propertyGetter(typeClass, names(index), parameterTypes(index))
+      if (accessor == null)
+        throw new ForyJsonException(
+          s"Missing Scala case-class accessor ${typeClass.getName}.${names(index)}"
+        )
+      if (
+        accessor.getParameterCount != 0 || !compatibleAccessor(accessor, parameterTypes(index)) ||
+        Modifier.isStatic(accessor.getModifiers) || accessor.isBridge || accessor.isSynthetic
+      ) {
+        throw new ForyJsonException(s"Invalid Scala case-class accessor $accessor")
+      }
+      accessors(index) = accessor
+      index += 1
+    }
+    val bodyFields = productFields(typeClass).filter(field => !names.contains(field.getName))
+    val bodyGetters = bodyFields.map(field => propertyGetter(typeClass, field.getName, field.getType))
+    val bodyPropertyIndexes = bodyGetters.indices.filter(index => bodyGetters(index) != null)
+    val propertyNames = names ++ bodyPropertyIndexes.map(index => bodyFields(index).getName)
+    val propertyGetters = accessors ++ bodyPropertyIndexes.map(index => bodyGetters(index))
+    val propertySetters =
+      Array.fill[Method](names.length)(null) ++
+        bodyPropertyIndexes.map(index => propertySetter(typeClass, bodyFields(index)))
+    val defaults = constructorDefaults(typeClass, parameterTypes)
+    resolver.createObjectCodec(
+      typeRef,
+      new JsonObjectModel(
+        constructor,
+        names,
+        accessors,
+        defaults,
+        propertyNames,
+        propertyGetters,
+        propertySetters
+      )
+    )
+  }
+
+  def singletonCodec(typeClass: Class[_]): JsonValueCodec[_] = {
+    val field = singletonField(typeClass)
+    if (field == null) null else new ScalaSingletonCodec(typeClass, field)
+  }
+
+  private def productFields(typeClass: Class[_]): Array[Field] = {
+    typeClass.getDeclaredFields.filter { field =>
+      val modifiers = field.getModifiers
+      !Modifier.isStatic(modifiers) && !field.isSynthetic && !field.getName.startsWith("$")
+    }
+  }
+
+  private def findPrimaryConstructor(typeClass: Class[_]): Constructor[_] = {
+    val constructors = typeClass.getConstructors
+    val methods = typeClass.getMethods
+    var selected: Constructor[_] = null
+    var index = 0
+    while (index < constructors.length) {
+      val constructor = constructors(index)
+      val parameterTypes = constructor.getParameterTypes
+      val matchingApply = methods.exists { method =>
+        method.getName == "apply" && Modifier.isStatic(method.getModifiers) && !method.isBridge &&
+        !method.isSynthetic && method.getReturnType == typeClass &&
+        sameTypes(method.getParameterTypes, parameterTypes)
+      }
+      if (!constructor.isSynthetic && !constructor.isVarArgs && matchingApply) {
+        if (selected != null) {
+          throw new ForyJsonException(s"Ambiguous Scala case-class primary constructor on ${typeClass.getName}")
+        }
+        selected = constructor
+      }
+      index += 1
+    }
+    selected
+  }
+
+  private def sameTypes(left: Array[Class[_]], right: Array[Class[_]]): Boolean = {
+    if (left.length != right.length) return false
+    var index = 0
+    while (index < left.length) {
+      if (left(index) != right(index)) return false
+      index += 1
+    }
+    true
... 2166 lines suppressed ...


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org