V - 对象类型@FunctionalInterface public interface JSONSerializer<V> extends TypeAdapter
| Modifier and Type | Method and Description |
|---|---|
JSON |
serialize(V bean,
JSONContext context)
序列化实现,通过实现此方法,将指定类型的对象转换为
JSON对象,可以:
如果为原始类型,可以转为JSONPrimitive
如果是集合或数组类,可以转为JSONArray
如果是Bean或键值对类型,可以转为JSONObject
|
JSON serialize(V bean, JSONContext context)
JSON对象,可以:
JSONPrimitiveJSONArrayJSONObjectbean - 指定类型对象context - JSON上下文,用于获取当前json节点或配置等信息Copyright © 2025. All rights reserved.