decodeFromString

open override fun <T> decodeFromString(deserializer: DeserializationStrategy<T>, string: String): T(source)

Deserializes string into a value of type T using deserializer.

Parameters

string

MUST be a TOML file, as this method delegates parsing to parseToTomlTable.

Throws

TomlDecodingException

if string cannot be parsed into TomlTable or cannot be deserialized.


fun <T> decodeFromString(deserializer: DeserializationStrategy<T>, string: String, vararg keys: Any?): T(source)

Parses string into a TomlTable and deserializes the corresponding element fetched with keys into a value of type T using deserializer.

Parameters

string

MUST be a TOML file, as this method delegates parsing to parseToTomlTable.

keys

the path which leads to the value. Each one item is a single segment. If a TomlArray is met, any direct child segment must be Int or String (will be parsed into integer).

See also

Throws

TomlDecodingException

if string cannot be parsed into TomlTable or the element cannot be deserialized.

NonPrimitiveKeyException

if provided non-primitive keys.