public class DateTimeParseException extends DateTimeException
此异常包括被解析的文本和错误索引。
| Constructor and Description |
|---|
DateTimeParseException(String message, CharSequence parsedData, int errorIndex)
使用指定的消息构造新的异常。
|
DateTimeParseException(String message, CharSequence parsedData, int errorIndex, Throwable cause)
构造一个新的异常与指定的消息和原因。
|
| Modifier and Type | Method and Description |
|---|---|
int |
getErrorIndex()
返回发现错误的索引。
|
String |
getParsedString()
返回要解析的字符串。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic DateTimeParseException(String message, CharSequence parsedData, int errorIndex)
message - 用于此异常的消息可能为null
parsedData - 解析的文本,不应该为null
errorIndex - 解析的字符串中无效的索引应为有效索引
public DateTimeParseException(String message, CharSequence parsedData, int errorIndex, Throwable cause)
message - 用于此异常的消息可能为null
parsedData - 解析文本不应为空
errorIndex - 解析的字符串中无效的索引应为有效索引
cause - 原因异常可能为null
public String getParsedString()
public int getErrorIndex()
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.