All Downloads are FREE. Search and download functionalities are using the official Maven repository.

codecs.basic.NonRecursiveJSONCodec.kt Maven / Gradle / Ivy

There is a newer version: 0.9.24
Show newest version
package com.github.fluidsonic.fluid.json

import kotlin.reflect.*


internal abstract class NonRecursiveJSONCodec private constructor(
	private val encoder: NonRecursiveJSONEncoderCodec
) :
	NonRecursiveJSONDecoderCodec(),
	JSONCodec,
	JSONEncoderCodec by encoder {


	override val encodableClass
		get() = encoder.encodableClass


	override fun  decoderCodecForType(decodableType: JSONCodingType) =
		super.decoderCodecForType(decodableType)


	override fun  encoderCodecForClass(encodableClass: KClass) =
		encoder.encoderCodecForClass(encodableClass)


	companion object {

		inline fun  create(): JSONCodec =
			object : NonRecursiveJSONCodec(
				encoder = NonRecursiveJSONEncoderCodec(encodableClass = Value::class)
			) {}
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy