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

com.infilos.relax.Json4s.scala Maven / Gradle / Ivy

There is a newer version: 2.17.0-0
Show newest version
package com.infilos.relax

import com.fasterxml.jackson.databind.{Module, ObjectMapper}
import com.fasterxml.jackson.module.scala.DefaultScalaModule
import com.infilos.relax.json.{JsonFactory, JsonMappers}

/**
  * @author infilos on 2020-06-13.
  *
  */
trait Json4s extends JsonMappers with JsonFactory {

  override def underMapper(): ObjectMapper = JsonMappers.ScalaMapper

  def registerModule(module: Module): Unit = {
    JsonMappers.JavaMapper.registerModule(module)
    JsonMappers.ScalaMapper.registerModule(module)
  }

  def registerModules(modules: Module*): Unit = {
    JsonMappers.JavaMapper.registerModules(modules: _*)
    JsonMappers.ScalaMapper.registerModules(modules: _*)
  }
}

object Json4s extends Json4s {
  {
    JsonMappers.ScalaMapper.registerModule(DefaultScalaModule)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy