gboat2.base.bridge.util.json
类 UnixTimestampDeserializer
java.lang.Object
com.fasterxml.jackson.databind.JsonDeserializer<Date>
gboat2.base.bridge.util.json.UnixTimestampDeserializer
public class UnixTimestampDeserializer
- extends com.fasterxml.jackson.databind.JsonDeserializer<Date>
自定义 jackson 反序列化实现类:将 Unix Timestamp 值(从 1970 年 1 月 1 日到现在的秒数)反序列化为
Date
对象。
public class Example {
@JsonDeserialize(using = UnixTimestampDeserializer.class)
private Date createTime;
// get, set
}
- 从以下版本开始:
- 2.1.2
- 作者:
- 何明旺
从类 com.fasterxml.jackson.databind.JsonDeserializer 继承的嵌套类/接口 |
com.fasterxml.jackson.databind.JsonDeserializer.None |
方法摘要 |
Date |
deserialize(com.fasterxml.jackson.core.JsonParser jp,
com.fasterxml.jackson.databind.DeserializationContext ctxt)
|
从类 com.fasterxml.jackson.databind.JsonDeserializer 继承的方法 |
deserialize, deserializeWithType, findBackReference, getDelegatee, getEmptyValue, getKnownPropertyNames, getNullValue, getObjectIdReader, handledType, isCachable, replaceDelegatee, unwrappingDeserializer |
从类 java.lang.Object 继承的方法 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnixTimestampDeserializer
public UnixTimestampDeserializer()
deserialize
public Date deserialize(com.fasterxml.jackson.core.JsonParser jp,
com.fasterxml.jackson.databind.DeserializationContext ctxt)
throws IOException,
com.fasterxml.jackson.core.JsonProcessingException
- 指定者:
- 类
com.fasterxml.jackson.databind.JsonDeserializer<Date>
中的 deserialize
- 抛出:
IOException
com.fasterxml.jackson.core.JsonProcessingException
Copyright © 2014 广联达软件股份有限公司(Glodon Software Co., Ltd.). All rights reserved.