uidsonic.fluid-json-coding.0.9.14.source-code.JSONEncoderCodec.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
import kotlin.reflect.KClass
interface JSONEncoderCodec : JSONCodecProvider {
val encodableClass: KClass
fun JSONEncoder.encode(value: Value)
override fun decoderCodecForType(decodableType: JSONCodingType): JSONDecoderCodec? =
null
@Suppress("UNCHECKED_CAST")
override fun encoderCodecForClass(encodableClass: KClass): JSONEncoderCodec? =
if (encodableClass.isAssignableOrBoxableTo(this.encodableClass))
this as JSONEncoderCodec
else
null
companion object
}