DateTimeParseException  |  API reference  |  Android Developers (original) (raw)

open class DateTimeParseException : DateTimeException

kotlin.Any
kotlin.Throwable
java.lang.Exception
java.lang.RuntimeException
java.time.DateTimeException

An exception thrown when an error occurs during parsing.

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

Summary

Public constructors
DateTimeParseException(message: String!, parsedData: CharSequence!, errorIndex: Int) Constructs a new exception with the specified message.
DateTimeParseException(message: String!, parsedData: CharSequence!, errorIndex: Int, cause: Throwable!) Constructs a new exception with the specified message and cause.
Public methods
open Int getErrorIndex() Returns the index where the error was found.
open String! getParsedString() Returns the string that was being parsed.

Public constructors

DateTimeParseException

DateTimeParseException(
    message: String!,
    parsedData: CharSequence!,
    errorIndex: Int)

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

DateTimeParseException

DateTimeParseException(
    message: String!,
    parsedData: CharSequence!,
    errorIndex: Int,
    cause: Throwable!)

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

Public methods

getErrorIndex

open fun getErrorIndex(): Int

Returns the index where the error was found.

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

getParsedString

open fun getParsedString(): String!

Returns the string that was being parsed.

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

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.