模块 java.base

类 DateTimeParseException

所有已实现的接口:
Serializable

public class DateTimeParseException extends DateTimeException
解析过程中发生错误时抛出的异常。

此异常包括正在解析的文本和错误索引。

实现要求:
此类旨在用于单个线程。
自从:
1.8
参见:
  • 构造方法详细信息

    • DateTimeParseException

      public DateTimeParseException(String  message, CharSequence  parsedData, int errorIndex)
      使用指定的消息构造一个新的异常。
      参数:
      message - 用于此异常的消息,可能为 null
      parsedData - 解析后的文本,不应为空
      errorIndex - 已解析字符串中无效的索引应该是有效索引
    • DateTimeParseException

      public DateTimeParseException(String  message, CharSequence  parsedData, int errorIndex, Throwable  cause)
      构造具有指定消息和原因的新异常。
      参数:
      message - 用于此异常的消息,可能为 null
      parsedData - 解析后的文本,不应为空
      errorIndex - 已解析字符串中无效的索引应该是有效索引
      cause - 原因异常,可能为空
  • 方法详情

    • getParsedString

      public String  getParsedString()
      返回正在解析的字符串。
      返回:
      正在解析的字符串不应为空。
    • getErrorIndex

      public int getErrorIndex()
      返回发现错误的索引。
      返回:
      已解析字符串中无效的索引应该是有效索引