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, toString
public DateTimeParseException(String message, CharSequence parsedData, int errorIndex)
message
消息-使用此异常,可能是空的
parsedData
-解析文本,不应为空
errorIndex
在解析字符串无效的指标,应该是一个有效的指标
public DateTimeParseException(String message, CharSequence parsedData, int errorIndex, Throwable cause)
message
消息-使用此异常,可能是空的
parsedData
-解析文本,不应为空
errorIndex
在解析字符串无效的指标,应该是一个有效的指标
cause
原因的异常,可能是空的
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.