阅读背景:

CustomJsonDateDeserializer @JsonDeserialize(using = CustomJsonDateDeserializer.class) Jackson 反序列化Date时遇到的问题 java中json日期属性反序列化

来源:互联网 
public class CustomJsonDateDeserializer extends JsonDeserializer<Date> {  
  
    @Override  
    public Date deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException {  
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
                String date = jp.getText();  
                try {  
                    return format.parse(date);  
                } catch (ParseException e) {  
                    throw new RuntimeException(e);  
                }  
    }  
  
}  
public class CustomJsonDateDeserializer ext



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: