コード例 #1
0
 @Override
 protected LocalDateTime fromString(String text) {
   DateTimeFormatter dateTimeFormatter = getDateTimeFormatter();
   if (dateTimeFormatter != null) {
     try {
       TemporalAccessor parse = dateTimeFormatter.parse(text);
       try {
         return LocalDateTime.from(parse);
       } catch (DateTimeException e) {
         CommonUtils.ignoreException(e);
       }
     } catch (DateTimeParseException e) {
       CommonUtils.ignoreException(e);
     }
   }
   return super.fromString(text);
 }
コード例 #2
0
 @Override
 public Boolean call(String text) {
   if (text.length() > getMaxLength()) return false;
   try {
     long i = parse(text);
     if (i >= getMin() && i <= getMax()) return true;
   } catch (DateTimeParseException e) {
     CommonUtils.ignoreException(e);
   }
   return false;
 }
コード例 #3
0
 @Override
 protected String toString(LocalDateTime value) {
   DateTimeFormatter formatter = getDateTimeFormatter();
   if (formatter != null) {
     try {
       return formatter.format(value);
     } catch (Exception e) {
       CommonUtils.ignoreException(e);
     }
   }
   return super.toString(value);
 }