public class TemporalAccessorSerializer extends Object implements JSONObjectSerializer<TemporalAccessor>, JSONDeserializer<TemporalAccessor>
TemporalAccessor
的JSON自定义序列化实现Constructor and Description |
---|
TemporalAccessorSerializer(Class<? extends TemporalAccessor> temporalAccessorClass) |
Modifier and Type | Method and Description |
---|---|
TemporalAccessor |
deserialize(JSON json)
反序列化,通过实现此方法,自定义实现JSON转换为指定类型的逻辑
|
void |
serialize(JSONObject json,
TemporalAccessor bean)
序列化实现,通过实现此方法,将指定类型的对象转换为
JSON 对象转换后的对象可以为JSONObject也可以为JSONArray,首先new一个空的JSON,然后将需要的数据字段put到JSON对象中去即可。 |
public TemporalAccessorSerializer(Class<? extends TemporalAccessor> temporalAccessorClass)
public void serialize(JSONObject json, TemporalAccessor bean)
JSONSerializer
JSON
对象serialize
in interface JSONSerializer<JSONObject,TemporalAccessor>
json
- JSON,可以为JSONObject或者JSONArraybean
- 指定类型对象public TemporalAccessor deserialize(JSON json)
JSONDeserializer
deserialize
in interface JSONDeserializer<TemporalAccessor>
json
- JSON
Copyright © 2024. All rights reserved.