implementations.StandardCodingParser.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluid-json-coding Show documentation
Show all versions of fluid-json-coding Show documentation
A JSON library written in pure Kotlin (coding extension)
package com.github.fluidsonic.fluid.json
internal class StandardCodingParser(
private val context: Context,
private val decoderFactory: (source: JSONReader, context: Context) -> JSONDecoder
) : JSONCodingParser {
override fun parseValueOfTypeOrNull(source: JSONReader, valueType: JSONCodingType, withTermination: Boolean) =
decoderFactory(source, context)
.withTermination(withTermination) { readValueOfTypeOrNull(valueType) }
}