Package io.islandtime.parser

Parsing of dates, times, durations, and intervals from textual representations.

Types

DateTimeParseException
Link copied to clipboard
common
class DateTimeParseException(message: String?, parsedString: String?, errorIndex: Int, cause: Throwable?) : DateTimeException
DateTimeParser
Link copied to clipboard
common
abstract class DateTimeParser

A parser that converts text into a collection of date-time fields that are understood throughout Island Time.

DateTimeParserBuilder
Link copied to clipboard
common
interface DateTimeParserBuilder
DateTimeParserDsl
Link copied to clipboard
common
annotation class DateTimeParserDsl
DateTimeParseResult
Link copied to clipboard
common
data class DateTimeParseResult(fields: MutableMap<DateTimeField, Long>, timeZoneId: String?)

The result of a parsing operation.

DateTimeParsers
Link copied to clipboard
common
object DateTimeParsers

A set of predefined parsers.

DateTimeParserSettings
Link copied to clipboard
common
data class DateTimeParserSettings(numberStyle: NumberStyle, locale: () -> Locale, isCaseSensitive: Boolean)

Settings that control the parsing behavior.

DecimalNumberParserBuilder
Link copied to clipboard
common
interface DecimalNumberParserBuilder : NumberParserBuilder
GroupedDateTimeParser
Link copied to clipboard
common
class GroupedDateTimeParser
GroupedDateTimeParserBuilder
Link copied to clipboard
common
interface GroupedDateTimeParserBuilder
LiteralParserBuilder
Link copied to clipboard
common
interface LiteralParserBuilder
NumberParserBuilder
Link copied to clipboard
common
interface NumberParserBuilder
SignParserBuilder
Link copied to clipboard
common
interface SignParserBuilder
SignStyle
Link copied to clipboard
common
enum SignStyle : Enum<SignStyle>
StringParseAction
Link copied to clipboard
common
enum StringParseAction : Enum<StringParseAction>
StringParserBuilder
Link copied to clipboard
common
interface StringParserBuilder
WholeNumberParserBuilder
Link copied to clipboard
common
interface WholeNumberParserBuilder : NumberParserBuilder

Functions

amPm
Link copied to clipboard
common
fun DateTimeParserBuilder.amPm()

Parse the AM or PM of the day from its textual representation.

dateTimeParser
Link copied to clipboard
common
inline fun dateTimeParser(builder: DateTimeParserBuilder.() -> Unit): DateTimeParser

Define a custom DateTimeParser.

dayOfMonth
Link copied to clipboard
common
inline fun DateTimeParserBuilder.dayOfMonth(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a day of the month value with a fixed number of digits.

inline fun DateTimeParserBuilder.dayOfMonth(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a day of the month value with a variable number of digits.

dayOfWeekNumber
Link copied to clipboard
common
inline fun DateTimeParserBuilder.dayOfWeekNumber(length: Int = 1, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a day of week number with a fixed number of digits.

dayOfYear
Link copied to clipboard
common
inline fun DateTimeParserBuilder.dayOfYear(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a day of the year value with a fixed number of digits.

inline fun DateTimeParserBuilder.dayOfYear(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a day of the year value with a variable number of digits.

durationOfFractionalSeconds
Link copied to clipboard
common
inline fun DateTimeParserBuilder.durationOfFractionalSeconds(wholeLength: IntRange = 1..19, fractionLength: IntRange = 0..9, fractionScale: Int = 9, crossinline builder: DecimalNumberParserBuilder.() -> Unit = {})

Parse a duration of fractional seconds.

durationOfHours
Link copied to clipboard
common
inline fun DateTimeParserBuilder.durationOfHours(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a duration of whole hours.

durationOfMinutes
Link copied to clipboard
common
inline fun DateTimeParserBuilder.durationOfMinutes(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a duration of whole minutes.

durationOfSeconds
Link copied to clipboard
common
inline fun DateTimeParserBuilder.durationOfSeconds(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a duration of whole seconds.

era
Link copied to clipboard
common
fun DateTimeParserBuilder.era(style: TextStyle)

Parse an era from its textual representation in a specific style.

fun DateTimeParserBuilder.era(styles: Set<TextStyle>)

Parse an era from its textual representation in any of the specified styles.

fractionalSecondOfMinute
Link copied to clipboard
common
inline fun DateTimeParserBuilder.fractionalSecondOfMinute(wholeLength: Int, fractionLength: IntRange = 0..9, fractionScale: Int = 9, crossinline builder: DecimalNumberParserBuilder.() -> Unit = {})

Parse a fractional second of the minute with a fixed number of characters representing the whole second.

inline fun DateTimeParserBuilder.fractionalSecondOfMinute(wholeLength: IntRange = 1..2, fractionLength: IntRange = 0..9, fractionScale: Int = 9, crossinline builder: DecimalNumberParserBuilder.() -> Unit = {})

Parse a fractional second of the minute.

groupedDateTimeParser
Link copied to clipboard
common
inline fun groupedDateTimeParser(builder: GroupedDateTimeParserBuilder.() -> Unit): GroupedDateTimeParser
hourOfDay
Link copied to clipboard
common
inline fun DateTimeParserBuilder.hourOfDay(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse an hour of the day with a fixed number of digits.

inline fun DateTimeParserBuilder.hourOfDay(length: IntRange = 1..2, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse an hour of the day with a variable number of digits.

localizedDayOfWeek
Link copied to clipboard
common
fun DateTimeParserBuilder.localizedDayOfWeek(style: TextStyle)

Parse a day of the week from its textual representation in a specific style.

fun DateTimeParserBuilder.localizedDayOfWeek(styles: Set<TextStyle>)

Parse a day of the week from its textual representation in any of the specified styles.

localizedMonth
Link copied to clipboard
common
fun DateTimeParserBuilder.localizedMonth(style: TextStyle)

Parse a month from its textual representation in a specific style.

fun DateTimeParserBuilder.localizedMonth(styles: Set<TextStyle>)

Parse a month from its textual representation in any of the specified styles.

minuteOfHour
Link copied to clipboard
common
inline fun DateTimeParserBuilder.minuteOfHour(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a minute of the hour with a fixed number of digits.

inline fun DateTimeParserBuilder.minuteOfHour(length: IntRange = 1..2, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a minute of the hour with a variable number of digits.

monthNumber
Link copied to clipboard
common
inline fun DateTimeParserBuilder.monthNumber(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a month of year number with a fixed number of digits.

inline fun DateTimeParserBuilder.monthNumber(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a month of year value with a variable number of digits.

periodOfDays
Link copied to clipboard
common
inline fun DateTimeParserBuilder.periodOfDays(length: IntRange = 1..10, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a period of whole days.

periodOfMonths
Link copied to clipboard
common
inline fun DateTimeParserBuilder.periodOfMonths(length: IntRange = 1..10, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a period of whole months.

periodOfWeeks
Link copied to clipboard
common
inline fun DateTimeParserBuilder.periodOfWeeks(length: IntRange = 1..10, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a period of whole weeks.

periodOfYears
Link copied to clipboard
common
inline fun DateTimeParserBuilder.periodOfYears(length: IntRange = 1..10, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a period of whole years.

periodSign
Link copied to clipboard
common
fun DateTimeParserBuilder.periodSign()

Parses a number's sign and populates DateTimeField.PERIOD_SIGN with -1L, if negative or 1L, if positive.

secondOfMinute
Link copied to clipboard
common
inline fun DateTimeParserBuilder.secondOfMinute(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a second of the minute with a fixed number of digits.

inline fun DateTimeParserBuilder.secondOfMinute(length: IntRange = 1..2, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a second of the minute with a variable number of digits.

timeZoneId
Link copied to clipboard
common
fun DateTimeParserBuilder.timeZoneId()

Parse a time zone region ID.

unboundedDesignator
Link copied to clipboard
common
fun DateTimeParserBuilder.unboundedDesignator()

Parses the string ".." and populates DateTimeField.IS_UNBOUNDED with 1L.

utcDesignator
Link copied to clipboard
common
fun DateTimeParserBuilder.utcDesignator()

Parses the character 'Z' and populates DateTimeField.UTC_OFFSET_TOTAL_SECONDS with 0L.

utcOffsetHours
Link copied to clipboard
common
inline fun DateTimeParserBuilder.utcOffsetHours(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})
utcOffsetMinutes
Link copied to clipboard
common
inline fun DateTimeParserBuilder.utcOffsetMinutes(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})
utcOffsetSeconds
Link copied to clipboard
common
inline fun DateTimeParserBuilder.utcOffsetSeconds(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})
utcOffsetSign
Link copied to clipboard
common
fun DateTimeParserBuilder.utcOffsetSign()

Parses a number's sign and populates DateTimeField.UTC_OFFSET_SIGN with -1L, if negative or 1L, if positive.

year
Link copied to clipboard
common
inline fun DateTimeParserBuilder.year(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a year with a fixed number of digits.

inline fun DateTimeParserBuilder.year(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a year with a variable number of digits.

yearOfEra
Link copied to clipboard
common
inline fun DateTimeParserBuilder.yearOfEra(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a year of era with a fixed number of digits.

inline fun DateTimeParserBuilder.yearOfEra(length: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a year of era with a variable number of digits.