DateTimeParserBuilder

interface DateTimeParserBuilder

Functions

anyOf
Link copied to clipboard
common
abstract fun anyOf(vararg childParsers: DateTimeParser)

Try each of the parsers defined by childParsers until one succeeds. If none succeed, parsing is considered to have failed.

abstract fun anyOf(vararg builders: DateTimeParserBuilder.() -> Unit)

Try each of the parsers defined by builders until one succeeds. If none succeed, parsing is considered to have failed.

caseInsensitive
Link copied to clipboard
common
abstract fun caseInsensitive(builder: DateTimeParserBuilder.() -> Unit)

Force parsing to be case-insensitive within this block.

caseSensitive
Link copied to clipboard
common
abstract fun caseSensitive(builder: DateTimeParserBuilder.() -> Unit)

Force parsing to be case-sensitive within this block.

childParser
Link copied to clipboard
common
abstract fun childParser(childParser: DateTimeParser)

Use a parser that has been defined outside of this builder.

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

Parse a decimal number.

literal
Link copied to clipboard
common
abstract fun literal(char: Char, builder: LiteralParserBuilder.() -> Unit = {})

Parse a Char literal.

abstract fun literal(string: String, builder: LiteralParserBuilder.() -> Unit = {})

Parse a String literal.

localizedText
Link copied to clipboard
common
abstract fun localizedText(field: DateTimeField, styles: Set<TextStyle>)

Parse localized text associated with a particular DateTimeField in any of the specified styles. If successful, the field's value will be populated. If no text is known for the field or a match can't be found, the parsing operation will return an error.

optional
Link copied to clipboard
common
abstract fun optional(builder: DateTimeParserBuilder.() -> Unit)

Make parsing optional within a block.

sign
Link copied to clipboard
common
abstract fun sign(builder: SignParserBuilder.() -> Unit = {})

Parse a character indicating the sign of a number.

string
Link copied to clipboard
common
abstract fun string(length: IntRange = IntRange.EMPTY, builder: StringParserBuilder.() -> Unit)

Parse a variable length string.

unaryPlus
Link copied to clipboard
common
open operator fun Char.unaryPlus()

Parse a Char literal.

open operator fun String.unaryPlus()

Parse a String literal.

wholeNumber
Link copied to clipboard
common
abstract fun wholeNumber(length: Int, builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a whole number of fixed length.

abstract fun wholeNumber(length: IntRange = 1..19, builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a whole number of variable length.

Extensions

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

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

dayOfMonth
Link copied to clipboard
common
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.

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

Parse a day of the month value with a fixed 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: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

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

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

Parse a day of the year value with a fixed 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(styles: Set<TextStyle>)

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

fun DateTimeParserBuilder.era(style: TextStyle)

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

fractionalSecondOfMinute
Link copied to clipboard
common
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.

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.

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

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

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

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

localizedDayOfWeek
Link copied to clipboard
common
fun DateTimeParserBuilder.localizedDayOfWeek(styles: Set<TextStyle>)

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

fun DateTimeParserBuilder.localizedDayOfWeek(style: TextStyle)

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

localizedMonth
Link copied to clipboard
common
fun DateTimeParserBuilder.localizedMonth(styles: Set<TextStyle>)

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

fun DateTimeParserBuilder.localizedMonth(style: TextStyle)

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

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

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

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

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

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

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

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

Parse a month of year number with a fixed 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: IntRange = 1..2, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

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

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

Parse a second of the minute with a fixed 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: IntRange = 1..19, crossinline builder: WholeNumberParserBuilder.() -> Unit = {})

Parse a year with a variable number of digits.

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

Parse a year with a fixed number of digits.

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

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

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

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