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

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

abstract class DateTimeParser
DateTimeParserBuilder
Link copied to clipboard
common
interface DateTimeParserBuilder
DateTimeParserDsl
Link copied to clipboard
common
annotation class DateTimeParserDsl
DateTimeParseResult
Link copied to clipboard
common

The result of a parsing operation.

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

A set of predefined parsers.

object DateTimeParsers
DateTimeParserSettings
Link copied to clipboard
common

Settings that control the parsing behavior.

data class DateTimeParserSettings(numberStyle: NumberStyle,locale: () -> Locale,isCaseSensitive: Boolean)
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

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

The result will be associated with DateTimeField.AM_PM_OF_DAY.

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

Define a custom DateTimeParser.

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

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

The result will be associated with DateTimeField.DAY_OF_MONTH.

inline fun DateTimeParserBuilder.dayOfMonth(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.DAY_OF_MONTH.

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

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

The result will be associated with DateTimeField.DAY_OF_WEEK.

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

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

The result will be associated with DateTimeField.DAY_OF_YEAR.

inline fun DateTimeParserBuilder.dayOfYear(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.DAY_OF_YEAR.

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

Parse a duration of fractional seconds.

The number of whole seconds will be associated with DateTimeField.DURATION_OF_SECONDS while any fractional part will be associated with DateTimeField.NANOSECOND_OF_SECOND. The decimal separator character will be determined by the DateTimeParserSettings.

inline fun DateTimeParserBuilder.durationOfFractionalSeconds(wholeLength: IntRange, fractionLength: IntRange, fractionScale: Int, crossinline builder: DecimalNumberParserBuilder.() -> Unit)
durationOfHours
Link copied to clipboard
common

Parse a duration of whole hours.

The number of hours will be associated with DateTimeField.DURATION_OF_HOURS.

inline fun DateTimeParserBuilder.durationOfHours(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
durationOfMinutes
Link copied to clipboard
common

Parse a duration of whole minutes.

The number of minutes will be associated with DateTimeField.DURATION_OF_MINUTES.

inline fun DateTimeParserBuilder.durationOfMinutes(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
durationOfSeconds
Link copied to clipboard
common

Parse a duration of whole seconds.

The number of seconds will be associated with DateTimeField.DURATION_OF_SECONDS.

inline fun DateTimeParserBuilder.durationOfSeconds(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
era
Link copied to clipboard
common

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

The result will be associated with DateTimeField.ERA.

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

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

The result will be associated with DateTimeField.ERA.

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

Parse a fractional second of the minute.

The number of whole seconds will be associated with DateTimeField.SECOND_OF_MINUTE while any fractional part will be associated with DateTimeField.NANOSECOND_OF_SECOND. The decimal separator character will be determined by the DateTimeParserSettings.

inline fun DateTimeParserBuilder.fractionalSecondOfMinute(wholeLength: IntRange, fractionLength: IntRange, fractionScale: Int, crossinline builder: DecimalNumberParserBuilder.() -> Unit)

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

The number of whole seconds will be associated with DateTimeField.SECOND_OF_MINUTE while any fractional part will be associated with DateTimeField.NANOSECOND_OF_SECOND. The decimal separator character will be determined by the DateTimeParserSettings.

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

Creates a GroupedDateTimeParser.

A grouped parser is capable of grouping the parsed fields into separate results, allowing fields to be reused within the same character sequence.

inline fun groupedDateTimeParser(builder: GroupedDateTimeParserBuilder.() -> Unit): GroupedDateTimeParser
hourOfDay
Link copied to clipboard
common

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

The result will be associated with DateTimeField.HOUR_OF_DAY.

inline fun DateTimeParserBuilder.hourOfDay(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.HOUR_OF_DAY.

inline fun DateTimeParserBuilder.hourOfDay(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit)
localizedDayOfWeek
Link copied to clipboard
common

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

The result will be associated with DateTimeField.DAY_OF_WEEK.

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

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

The result will be associated with DateTimeField.DAY_OF_WEEK.

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

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

The result will be associated with DateTimeField.MONTH_OF_YEAR.

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

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

The result will be associated with DateTimeField.MONTH_OF_YEAR.

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

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

The result will be associated with DateTimeField.MINUTE_OF_HOUR.

inline fun DateTimeParserBuilder.minuteOfHour(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.MINUTE_OF_HOUR.

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

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

The result will be associated with DateTimeField.MONTH_OF_YEAR.

inline fun DateTimeParserBuilder.monthNumber(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.MONTH_OF_YEAR.

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

Parse a period of whole days.

The number of days will be associated with DateTimeField.PERIOD_OF_DAYS.

inline fun DateTimeParserBuilder.periodOfDays(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
periodOfMonths
Link copied to clipboard
common

Parse a period of whole months.

The number of months will be associated with DateTimeField.PERIOD_OF_MONTHS.

inline fun DateTimeParserBuilder.periodOfMonths(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
periodOfWeeks
Link copied to clipboard
common

Parse a period of whole weeks.

The number of weeks will be associated with DateTimeField.PERIOD_OF_WEEKS.

inline fun DateTimeParserBuilder.periodOfWeeks(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
periodOfYears
Link copied to clipboard
common

Parse a period of whole years.

The number of years will be associated with DateTimeField.PERIOD_OF_YEARS.

inline fun DateTimeParserBuilder.periodOfYears(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)
periodSign
Link copied to clipboard
common

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

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

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

The result will be associated with DateTimeField.SECOND_OF_MINUTE.

inline fun DateTimeParserBuilder.secondOfMinute(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.SECOND_OF_MINUTE.

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

Parse a time zone region ID.

The format should match that defined in the IANA time zone database. The parsed string will be associated with DateTimeParseResult.timeZoneId.

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

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

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

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

fun DateTimeParserBuilder.utcDesignator()
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

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

fun DateTimeParserBuilder.utcOffsetSign()
year
Link copied to clipboard
common

Parse a year with a variable number of digits.

The result will be associated with DateTimeField.YEAR.

inline fun DateTimeParserBuilder.year(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

Parse a year with a fixed number of digits.

The result will be associated with DateTimeField.YEAR.

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

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

The result will be associated with DateTimeField.YEAR_OF_ERA.

inline fun DateTimeParserBuilder.yearOfEra(length: IntRange, crossinline builder: WholeNumberParserBuilder.() -> Unit)

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

The result will be associated with DateTimeField.YEAR_OF_ERA.

inline fun DateTimeParserBuilder.yearOfEra(length: Int, crossinline builder: WholeNumberParserBuilder.() -> Unit)