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

uidsonic.fluid-json-basic.0.9.24.source-code.JSONSerializer.kt Maven / Gradle / Ivy

The newest version!
package com.github.fluidsonic.fluid.json

import java.io.*


interface JSONSerializer {

	fun serializeValue(value: Any?, destination: JSONWriter, withTermination: Boolean = true)


	companion object {

		val default: JSONSerializer get() = StandardSerializer
	}
}


fun JSONSerializer.serializeValue(value: Any?) =
	StringWriter().apply { serializeValue(value, destination = this) }.toString()


fun JSONSerializer.serializeValue(value: Any?, destination: Writer, withTermination: Boolean = true) =
	serializeValue(value, destination = JSONWriter.build(destination), withTermination = withTermination)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy