Package | Description |
---|---|
org.dromara.hutool.json |
JSON(JavaScript Object Notation JavaScript对象表示法)封装
规范见:https://www.rfc-editor.org/rfc/rfc8259 包含以下组件: JSONObject: 使用键值对表示的数据类型,使用"{}"包围 JSONArray: 使用列表表示的数据类型,使用"[]"包围 JSONPrimitive:表示boolean、String、Number等原始类型 JSON封装主要包括JSON表示和JSON转换:
<-----JSONMapper----- <---JSONParser----
Java对象 <====================> JSON对象 <=================> JSON字符串
-----JSONMapper-----> ---JSONWriter---->
当然,为了高效转换,如果没有自定义需求,Java对象可以不通过JSON对象与JSON字符串转换:
JSONTokener:JSON字符串底层解析器,通过Stream方式读取JSON字符串并对不同字段自定义处理。 |
Modifier and Type | Method and Description |
---|---|
JSONConfig.DuplicateMode |
JSONConfig.getDuplicateMode()
获取key重复策略
|
static JSONConfig.DuplicateMode |
JSONConfig.DuplicateMode.valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static JSONConfig.DuplicateMode[] |
JSONConfig.DuplicateMode.values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
Modifier and Type | Method and Description |
---|---|
JSONConfig |
JSONConfig.set(JSONConfig.DuplicateMode duplicateMode)
设置key重复策略
|
Copyright © 2025. All rights reserved.