| Package | Description |
|---|---|
| org.dromara.hutool.json.serializer |
JSON序列化和反序列化,提供对象和JSON之间的转换,我们定义:
1.
|
| Modifier and Type | Method and Description |
|---|---|
static TypeAdapterManager |
TypeAdapterManager.getInstance()
获得单例的 TypeAdapterManager
|
TypeAdapterManager |
JSONMapper.getTypeAdapterManager()
获取自定义类型转换器,用于将自定义类型转换为JSONObject
|
static TypeAdapterManager |
TypeAdapterManager.of()
创建空的TypeAdapterManager
|
TypeAdapterManager |
TypeAdapterManager.register(TypeAdapter typeAdapter)
注册自定义类型适配器,用于自定义对象序列化和反序列化
提供的适配器必须为实现 MatcherJSONSerializer或MatcherJSONDeserializer接口当两个接口都实现时,同时注册序列化和反序列化器 |
TypeAdapterManager |
TypeAdapterManager.register(Type type,
TypeAdapter typeAdapter)
注册自定义类型适配器,用于自定义对象序列化和反序列化
|
| Modifier and Type | Method and Description |
|---|---|
JSONMapper |
JSONMapper.setTypeAdapterManager(TypeAdapterManager typeAdapterManager)
设置自定义类型转换器,用于将自定义类型转换为JSONObject
|
Copyright © 2024. All rights reserved.