Commit e03b5355 by s_guodong

update

parent 2f38d516
...@@ -41,14 +41,16 @@ public class MyDateDeSerialized extends JsonDeserializer { ...@@ -41,14 +41,16 @@ public class MyDateDeSerialized extends JsonDeserializer {
try { try {
date = simpleDateFormat.parse(source); date = simpleDateFormat.parse(source);
} catch (ParseException e) { } catch (ParseException e) {
ValidatorUtil.CHECK_ERR_MSG.set(annotation.message()); ValidatorUtil.CHECK_ERR_MSG.set(annotation == null ? "时间格式不正确" : annotation.message());
return null; return null;
} }
String regexp = annotation.regexp(); if (annotation != null) {
boolean match = source.matches(regexp); String regexp = annotation.regexp();
if (!match) { boolean match = source.matches(regexp);
ValidatorUtil.CHECK_ERR_MSG.set(annotation.message()); if (!match) {
return null; ValidatorUtil.CHECK_ERR_MSG.set(annotation.message());
return null;
}
} }
} }
return date; return date;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment