APIdia Launch Partner
Top Description Fields Constructors Methods
java.time.format

public Class DateTimeParseException

extends DateTimeException
Class Inheritance
Imports
java.time.DateTimeException

An exception thrown when an error occurs during parsing.

This exception includes the text being parsed and the error index.

Implementation Specification

This class is intended for use in a single thread.

Since
1.8

Field Summary

Modifier and TypeField and Description
private final int
private final String
private static final long

Constructor Summary

AccessConstructor and Description
public
DateTimeParseException(String
the message to use for this exception, may be null
message
,
CharSequence
the parsed text, should not be null
parsedData
,
int
the index in the parsed string that was invalid, should be a valid index
errorIndex
)

Constructs a new exception with the specified message.

public
DateTimeParseException(String
the message to use for this exception, may be null
message
,
CharSequence
the parsed text, should not be null
parsedData
,
int
the index in the parsed string that was invalid, should be a valid index
errorIndex
,
Throwable
the cause exception, may be null
cause
)

Constructs a new exception with the specified message and cause.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the index in the parsed string that was invalid, should be a valid index
getErrorIndex
()

Returns the index where the error was found.

public String

Returns:

the string that was being parsed, should not be null.
getParsedString
()

Returns the string that was being parsed.

Field Detail

errorIndexback to summary
private final int errorIndex
parsedStringback to summary
private final String parsedString
serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.time.DateTimeException.serialVersionUID.

Serialization version.

Annotations
@Serial

Constructor Detail

DateTimeParseExceptionback to summary
public DateTimeParseException(String message, CharSequence parsedData, int errorIndex)

Constructs a new exception with the specified message.

Parameters
message:String

the message to use for this exception, may be null

parsedData:CharSequence

the parsed text, should not be null

errorIndex:int

the index in the parsed string that was invalid, should be a valid index

DateTimeParseExceptionback to summary
public DateTimeParseException(String message, CharSequence parsedData, int errorIndex, Throwable cause)

Constructs a new exception with the specified message and cause.

Parameters
message:String

the message to use for this exception, may be null

parsedData:CharSequence

the parsed text, should not be null

errorIndex:int

the index in the parsed string that was invalid, should be a valid index

cause:Throwable

the cause exception, may be null

Method Detail

getErrorIndexback to summary
public int getErrorIndex()

Returns the index where the error was found.

Returns:int

the index in the parsed string that was invalid, should be a valid index

getParsedStringback to summary
public String getParsedString()

Returns the string that was being parsed.

Returns:String

the string that was being parsed, should not be null.