Skip to content

Index

//hexagon_core/com.hexagonkt.serialization

Package com.hexagonkt.serialization

[jvm]

Parse/serialize data in different formats to class instances.

Types

Name Summary
ContentType [jvm]
Content
data class ContentType(format: SerializationFormat, charset: Charset?)


Mapper [jvm]
Content
interface Mapper


ParseException [jvm]
Content
class ParseException(field: String, cause: Throwable?) : RuntimeException


SerializationFormat [jvm]
Content
interface SerializationFormat


SerializationManager [jvm]
Content
object SerializationManager
More info
TODOCan be a Serializer immutable class and:object SerializationManager : Serializer(mimeTypesResource, formats)


SerializationTest [jvm]
Content
abstract class SerializationTestT : Any>(type: KClass<T>)


Functions

Name Summary
convertToMap [jvm]
Content
fun Any.convertToMap(): Map<, >


convertToObject [jvm]
Content
inline fun <T : Any> Map<, >.convertToObject(): T
fun <T : Any> Map<, >.convertToObject(type: KClass<T>): T


convertToObjects [jvm]
Content
inline fun <T : Any> List<Map<, >>.convertToObjects(): List<T>
fun <T : Any> List<Map<, >>.convertToObjects(type: KClass<T>): List<T>


parse [jvm]
Content
inline fun <T : Any> File.parse(): T
inline fun <T : Any> URL.parse(): T
fun <T : Any> File.parse(type: KClass<T>): T
inline fun <T : Any> InputStream.parse(format: SerializationFormat = requireDefaultFormat()): T
fun <T : Any> URL.parse(type: KClass<T>): T
inline fun <T : Any> String.parse(format: SerializationFormat = requireDefaultFormat()): T
fun <T : Any> InputStream.parse(type: KClass<T>, format: SerializationFormat = requireDefaultFormat()): T
fun <T : Any> String.parse(type: KClass<T>, format: SerializationFormat = requireDefaultFormat()): T


parseObjects [jvm]
Content
inline fun <T : Any> File.parseObjects(): List<T>
inline fun <T : Any> URL.parseObjects(): List<T>
fun <T : Any> File.parseObjects(type: KClass<T>): List<T>
inline fun <T : Any> InputStream.parseObjects(format: SerializationFormat = requireDefaultFormat()): List<T>
fun <T : Any> URL.parseObjects(type: KClass<T>): List<T>
inline fun <T : Any> String.parseObjects(format: SerializationFormat = requireDefaultFormat()): List<T>
fun <T : Any> InputStream.parseObjects(type: KClass<T>, format: SerializationFormat = requireDefaultFormat()): List<T>
fun <T : Any> String.parseObjects(type: KClass<T>, format: SerializationFormat = requireDefaultFormat()): List<T>


serialize [jvm]
Content
fun Any.serialize(format: SerializationFormat = requireDefaultFormat()): String
fun Any.serialize(contentType: String): String