private static boolean datetime(Text t, List<Object> valueList) { final boolean result; final int start = t.cursor(); if (t.consume('@') && date(t) && t.ws() && time(t)) { final String string = t.getString(start + 1); // Jump the'@' final LocalDateTime value = DateU.parseStandardDatetime(string); valueList.add(value); result = true; } else { result = false; } return result; }
/** * There's a bug in this as it requires seconds in the string whereas the time() function does * not. It seems to be in the Java parser. * * @param tb Source to parse. * @return A Temporal or null if none found. */ @Nullable private static Temporal temporal(Text t) { Temporal result; final int save = t.cursor(); t.consume('@'); final int start = save + 1; // yyyy/MM/dd HH:mm:ss try { if (date(t)) { final int save2 = t.cursor(); t.ws(); if (time(t)) { final String string = t.getString(start); result = DateU.parseStandardDatetime(string); } else { t.setCursor(save2); final String string = t.getString(start); result = DateU.parseStandardDate(string); } } else if (time(t)) { final String string = t.getString(start); result = DateU.parseStandardTime(string); } else { result = null; t.setCursor(save); } } catch (final DateTimeParseException e) { result = null; t.setCursor(save); } return result; }