Package cloud.opencode.base.json
package cloud.opencode.base.json
OpenCode JSON - Unified JSON Processing Facade
OpenCode JSON - 统一 JSON 处理门面
This package provides a unified facade API for JSON serialization/deserialization with SPI mechanism supporting multiple JSON engines (Jackson, Gson, Fastjson2).
本包提供统一的 JSON 序列化/反序列化门面 API,通过 SPI 机制支持多种 JSON 引擎 (Jackson、Gson、Fastjson2)。
Key Classes | 核心类:
OpenJson- Static facade entry point - 静态门面入口TypeReference- Generic type reference - 泛型类型引用JsonConfig- JSON configuration - JSON 配置JsonNode- Generic JSON node - 通用 JSON 节点
Sub-packages | 子包:
spi- SPI provider interfaces - SPI 提供者接口path- JSONPath and JsonPointer - JSONPath 和 JsonPointerstream- Streaming API - 流式 APIannotation- JSON annotations - JSON 注解exception- JSON exceptions - JSON 异常patch- JSON Patch/Merge Patch - JSON 补丁schema- JSON Schema validation - JSON Schema 验证diff- JSON diff comparison - JSON 差异比较security- Security features - 安全特性adapter- Type adapters - 类型适配器
Usage Examples | 使用示例:
// Serialize
String json = OpenJson.toJson(user);
// Deserialize
User user = OpenJson.fromJson(json, User.class);
// Generic type
List<User> users = OpenJson.fromJson(json, new TypeReference<List<User>>() {});
// JSONPath
String name = OpenJson.read(json, "$.user.name");
- Since:
- JDK 25, opencode-base-json V1.0.0
- Author:
- Leon Soo www.LeonSoo.com
- See Also:
-
ClassDescriptionJSON Config - Configuration for JSON Processing JSON 配置 - JSON 处理的配置Builder for JsonConfig.JSON Node - Universal JSON Tree Representation JSON 节点 - 通用 JSON 树表示Array Node - Represents a JSON array.Boolean Node - Represents a JSON boolean.Null Node - Represents a JSON null.Number Node - Represents a JSON number.Object Node - Represents a JSON object.String Node - Represents a JSON string.Mixin Source - Manages Mixin Annotation Mappings 混入源 - 管理混入注解映射OpenJson - Unified JSON Processing Facade OpenJson - 统一 JSON 处理门面Property Filter - Dynamic Property Filtering for JSON Serialization 属性过滤器 - JSON 序列化的动态属性过滤Type Reference - Generic Type Token for JSON Deserialization 类型引用 - 用于 JSON 反序列化的泛型类型令牌