Java 类com.alibaba.fastjson.parser.deserializer.DateDeserializer 实例源码

项目:uavstack    文件:CalendarCodec.java   
@SuppressWarnings("unchecked")
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
    Object value = DateDeserializer.instance.deserialze(parser, type, fieldName);

    if (value instanceof Calendar) {
        return (T) value;
    }

    Date date = (Date) value;
    if (date == null) {
        return null;
    }

    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);

    return (T) calendar;
}
项目:boohee_v5.6    文件:CalendarCodec.java   
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
    Date value = DateDeserializer.instance.deserialze(parser, type, fieldName);
    if (value instanceof Calendar) {
        return value;
    }
    Date date = value;
    if (date == null) {
        return null;
    }
    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);
    return calendar;
}
项目:itmarry    文件:CalendarCodec.java   
@SuppressWarnings("unchecked")
public <T> T deserialze(DefaultJSONParser parser, Type type, Object fieldName) {
    Date date = DateDeserializer.instance.deserialze(parser, type, fieldName);

    Calendar calendar = Calendar.getInstance();
    calendar.setTime(date);

    return (T) calendar;
}