Class DateTimeParseException

All Implemented Interfaces:
Serializable

public class DateTimeParseException extends MismatchedInputException
Specialized exception to be thrown when deserialization of java.time instances fails due to DateTimeException or related exceptions.

This exception is used to wrap DateTimeExceptions and ArithmeticExceptions that occur during parsing or construction of java.time objects (like LocalDateTime, LocalDate, LocalTime, etc.), providing better error context for Jackson deserialization failures.

Since:
3.1
See Also:
  • Field Details

    • _value

      protected final String _value
      The value that failed to be parsed into a java.time instance.
  • Constructor Details

    • DateTimeParseException

      public DateTimeParseException(tools.jackson.core.JsonParser p, String msg, String value, Class<?> targetType, Throwable cause)
  • Method Details

    • from

      public static DateTimeParseException from(tools.jackson.core.JsonParser p, String msg, String value, Class<?> targetType, Throwable cause)
      Factory method for constructing an instance with given arguments.
      Parameters:
      p - Parser in use when exception occurred
      msg - Error message
      value - The value that could not be parsed
      targetType - Type we attempted to deserialize into
      cause - The underlying exception (typically DateTimeException or ArithmeticException)
      Returns:
      New DateTimeParseException instance
    • getValue

      public String getValue()
      Accessor for the value that could not be parsed.
      Returns:
      The string value that failed to parse, if available