Parsers

internal object Parsers : GlobalParserOptions

Central implementation for GlobalParserOptions.

Can be obtained by a user by calling DataFrame.parser.

Defaults are set by resetToDefault.

Properties

Link copied to clipboard
open override val availableParserTypes: Set<KType>

Provides an overview of all types DataFrame can parse to. This cannot be adjusted yet (#962).

Link copied to clipboard

DataFrame supports parsing to either kotlin(x)-datetime or java.time types.

Link copied to clipboard
open override var locale: Locale

The Locale to use for parsing numbers (and Java date-time types), defaults to the System default locale. This can be overridden by passing a custom ParserOptions to the parsing function call.

Link copied to clipboard
open override val nulls: Set<String>

When a String is encountered matching any of these, it will be parsed to null. This can be overridden by passing a custom ParserOptions to the parsing function call.

Link copied to clipboard

Whether to allow parsing to the kotlin.time.Instant type. This is marked "stable" from Kotlin 2.3.0+, so, by default this is true.

Link copied to clipboard
open override var parseExperimentalUuid: Boolean

Whether to allow parsing UUIDs to the Uuid type. This is marked "stable" from Kotlin 2.4.0+, so, by default this is true.

Link copied to clipboard
Link copied to clipboard
val size: Int
Link copied to clipboard
open override val skipTypes: Set<KType>

Types in this set will be skipped during parsing. Parsing will be attempted for all other types.

Link copied to clipboard
Link copied to clipboard
open override var useFastDoubleParser: Boolean

Whether to use FastDoubleParser, defaults to true. Please report any issues you encounter. This can be overridden by passing a custom ParserOptions to the parsing function call.

Functions

Link copied to clipboard
open override fun addDateTimeFormat(format: DateTimeFormat<out Any>, formatType: KType)

Adds format to the global parser options of DataFrame.

Link copied to clipboard
inline fun <reified T : Any> GlobalParserOptions.addDateTimeFormat(format: DateTimeFormat<out T>)

Adds format to the global parser options of DataFrame.

Link copied to clipboard
open fun addDateTimePattern(pattern: String)

Deprecated:

Link copied to clipboard
@FormatStringsInDatetimeFormats
open override fun addDateTimeUnicodePattern(pattern: String, formatType: KType)

Adds a Unicode date-time pattern to the global parser options of DataFrame.

Link copied to clipboard
@FormatStringsInDatetimeFormats
inline fun <reified T : Any> GlobalParserOptions.addDateTimeUnicodePattern(pattern: String)

Adds a Unicode date-time pattern to the global parser options of DataFrame.

Link copied to clipboard
open override fun addJavaDateTimeFormatter(formatter: DateTimeFormatter, formatType: KType? = null)

Adds a Java-based date-time formatter to the global parser options of DataFrame.

Link copied to clipboard

Adds a Java-based date-time formatter to the global parser options of DataFrame.

Link copied to clipboard
open override fun addJavaDateTimePattern(pattern: String, formatType: KType? = null)

Adds a Java-based date-time pattern to the global parser options of DataFrame.

Link copied to clipboard

Adds a Java-based date-time pattern to the global parser options of DataFrame.

Link copied to clipboard
open override fun addNullString(str: String)

Adds str to the collection of Strings that will be parsed to null.

Link copied to clipboard
open override fun addSkipType(type: KType)

This function can be called to skip some types. Parsing will be attempted for all other types.

Link copied to clipboard
inline fun <reified T : Any> get(): List<StringParser<T>>
operator fun get(index: Int): StringParser<*>
operator fun <T : Any> get(type: KClass<T>): List<StringParser<T>>
operator fun get(type: KType): List<StringParser<*>>
Link copied to clipboard

Turns the parsers of given type into a converter.

Link copied to clipboard
open override fun resetToDefault()

Resets the global parser options.

Link copied to clipboard
inline fun <reified T : Any> stringParser(catch: Boolean = false, name: String? = null, noinline body: ParserFunction<T>): StringParser<T>
Link copied to clipboard
inline fun <reified T : Any> stringParserWithOptions(name: String? = null, type: KType = typeOf<T>(), noinline getParser: (options: ParserOptions?, isConverter: Boolean) -> ParserFunction<T>): StringParser<T>
inline fun <reified T : Any> stringParserWithOptionsAndAttemptedParsers(name: String? = null, type: KType = typeOf<T>(), noinline getParser: (options: ParserOptions?, attemptedParsers: List<KType>, isConverter: Boolean) -> ParserFunction<T>): StringParser<T>