awesome-repositories.com
博客
awesome-repositories.com

通过 AI 驱动的搜索,发现最优秀的开源仓库。

探索精选搜索开源替代品自托管软件博客网站地图
项目关于排名机制媒体报道MCP 服务器
法律隐私政策服务条款
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
·
square avatar

square/moshi

0
View on GitHub↗
10,138 星标·804 分支·Kotlin·Apache-2.0·8 次浏览square.github.io/moshi/1.x↗

Moshi

Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects.

The library distinguishes itself through compile-time adapter generation, which removes the performance overhead associated with runtime reflection. It also provides a polymorphic JSON mapper that uses type identifiers to resolve and instantiate specific subclasses of a common base type.

The framework supports custom adapter definitions for specialized type conversion, including nullability constraint enforcement and contextual encoding via qualifiers. Its mapping capabilities cover field renaming, enum fallback management, property exclusion, and value class inlining. Additionally, it provides low-level streaming tools for raw value processing and non-destructive token peeking.

Features

  • JSON Serialization Libraries - Functions as a high-performance library for converting Kotlin and Java objects to and from JSON.
  • Compile-Time Code Generation - Produces optimized serialization logic at compile time to eliminate the performance overhead of runtime reflection.
  • Custom Type Converters - Provides mechanisms to define specific logic for converting complex objects to control the resulting JSON string format.
  • JSON Converters - Provides a framework for defining custom converters to handle specialized type transformations during JSON serialization.
  • JSON-to-Model Mappers - Converts JSON strings into typed language objects by mapping keys to class fields.
  • Custom Field Mapping - Provides customization of object field mapping to JSON keys using annotations to bridge naming conventions.
  • JSON Parsers - Implements a JSON parser specifically optimized for Kotlin, supporting null safety and code generation.
  • Reflectionless Encoders - Provides a reflectionless encoding mechanism using compile-time generated adapters for maximum performance.
  • Type Safe Parsing - Ensures data integrity by mapping JSON input to strongly typed objects with strict nullability enforcement.
  • JSON Serialization - Parses classes, primitives, and collections into JSON strings and back using built-in or generated logic.
  • Adapter-Based Mapping - Implements a system of dedicated adapters to map JSON keys to class properties and vice versa.
  • Reflectionless Serialization - Uses compile-time adapter generation to eliminate the performance costs associated with runtime reflection.
  • Serialization Adapters - Provides modular components that encapsulate custom logic for converting specific data types during serialization.
  • Contextual Serialization Rules - Uses qualifiers to apply different encoding rules to the same data type based on the specific field context.
  • Data Parsing Utilities - Converts complex types like dates into standard objects using prebuilt adapters during the parsing process.
  • Polymorphic Mapping - Embeds type identifiers in the JSON to resolve and instantiate specific subclasses of a common base type.
  • Token-Based Stream Parsing - Reads JSON data as a sequence of tokens allowing for peek operations without consuming the underlying stream.
  • Compositional Wrappers - Wraps existing adapters in modifiers to add behavioral logic like null safety or data transformation.
  • Nullability Constraint Enforcement - Enables the creation of adapters that forbid nulls in the data body and fail immediately when encountered.
  • Contextual Encoding Qualifiers - Uses qualifiers to apply different encoding rules to the same data type based on the specific field context.
  • JSON 处理 - Modern, unopinionated JSON library using standard Java types.
  • Android Development Utilities - Modern JSON library for Android and Java.
  • Data Serialization - Modern JSON library for Android and Java.

Star 历史

square/moshi 的 Star 历史图表square/moshi 的 Star 历史图表

AI 搜索

探索更多 awesome 仓库

用简单的语言描述您的需求 —— AI 将根据相关性为您从数千个精选开源项目中进行排序。

Start searching with AI

Moshi 的开源替代方案

相似的开源项目,按与 Moshi 的功能重合度排序。
  • fasterxml/jacksonFasterXML 的头像

    FasterXML/jackson

    9,740在 GitHub 上查看↗

    Jackson is a Java data binding framework and multi-format data serializer used to translate data structures into native language objects. It functions as a JSON data binding library and a streaming parser that reads and writes data as discrete tokens to process large datasets with minimal memory. The project distinguishes itself through a bytecode serialization accelerator that replaces standard reflection with generated bytecode to increase data binding speed. It employs a module-based extensibility model to support a wide range of formats beyond JSON, including XML, YAML, CSV, TOML, and bin

    hacktoberfestjacksonjava-json
    在 GitHub 上查看↗9,740
  • google/gsongoogle 的头像

    google/gson

    24,357在 GitHub 上查看↗

    Gson is a Java library designed for the serialization and deserialization of objects into structured text formats. It functions as a reflection-based data mapper, inspecting class structures at runtime to automatically convert memory-resident objects into data representations and reconstruct them back into typed language objects. The library distinguishes itself through a modular type-adapter pattern that allows for custom conversion rules for complex or nested structures. It also provides robust support for production environments by generating build-time metadata and configuration rules, wh

    Java
    在 GitHub 上查看↗24,357
  • ijl/orjsonijl 的头像

    ijl/orjson

    8,110在 GitHub 上查看↗

    orjson is a high-performance Python library for serializing and deserializing JSON data. It functions as both a JSON parsing library and a serialization engine, converting data between native Python objects and UTF-8 encoded bytes. The project provides specialized support for converting complex Python data structures, including dataclasses, datetime objects, and NumPy arrays and scalars, into JSON format. It also allows for the insertion of pre-serialized JSON blobs into documents to maintain processing speed. The library includes capabilities for memory-efficient deserialization through key

    Pythondataclassesdatetimedeserialization
    在 GitHub 上查看↗8,110
  • alibaba/fastjsonalibaba 的头像

    alibaba/fastjson

    25,625在 GitHub 上查看↗

    Fastjson is a Java data binding framework and serialization library designed to convert objects to JSON strings and parse JSON data into typed objects. It functions as a JSON parser and stream processor capable of transforming JSON strings into data structures. The project emphasizes high performance JSON processing and memory management, specifically through the use of a pipeline to stream oversized JSON objects and texts to prevent memory exhaustion. It provides capabilities for JSON data serialization and deserialization workflows, including custom JSON data mapping and the ability to def

    Java
    在 GitHub 上查看↗25,625
查看 Moshi 的所有 30 个替代方案→

常见问题解答

square/moshi 是做什么的?

Moshi is a JSON serialization library and parser for Kotlin and Java. It functions as a reflectionless JSON encoder that converts typed objects to JSON strings and parses JSON data back into language objects.

square/moshi 的主要功能有哪些?

square/moshi 的主要功能包括:JSON Serialization Libraries, Compile-Time Code Generation, Custom Type Converters, JSON Converters, JSON-to-Model Mappers, Custom Field Mapping, JSON Parsers, Reflectionless Encoders。

square/moshi 有哪些开源替代品?

square/moshi 的开源替代品包括: fasterxml/jackson — Jackson is a Java data binding framework and multi-format data serializer used to translate data structures into… google/gson — Gson is a Java library designed for the serialization and deserialization of objects into structured text formats. It… ijl/orjson — orjson is a high-performance Python library for serializing and deserializing JSON data. It functions as both a JSON… alibaba/fastjson — Fastjson is a Java data binding framework and serialization library designed to convert objects to JSON strings and… alibaba/handyjson — HandyJSON is a Swift JSON serialization library and data mapper. It functions as an object mapper that converts JSON… codermjlee/mjextension — MJExtension is a JSON serialization library and model mapping framework used to convert data between JSON strings and…