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

com.lightningkite.khrysalis.replacements.JacksonReplacementsModule.kt Maven / Gradle / Ivy

The newest version!
package com.lightningkite.khrysalis.replacements

import com.fasterxml.jackson.core.JsonGenerator
import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.core.JsonToken
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.SerializerProvider
import com.fasterxml.jackson.databind.deser.std.StdDeserializer
import com.fasterxml.jackson.databind.module.SimpleModule
import com.fasterxml.jackson.databind.node.ArrayNode
import com.fasterxml.jackson.databind.node.ObjectNode
import com.fasterxml.jackson.databind.ser.std.StdSerializer

abstract class JacksonReplacementsModule() : SimpleModule() {

    abstract fun parseImports(node: JsonNode): List

    init {
        addSerializer(Template::class.java, object: StdSerializer