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

org.json4s.JsonFormat.scala Maven / Gradle / Ivy

There is a newer version: 4.1.0-M8
Show newest version
package org.json4s

import annotation.implicitNotFound

object JsonFormat extends FormatFunctions {
  implicit def GenericFormat[T](implicit reader: Reader[T], writer: Writer[T]): JsonFormat[T] = new JsonFormat[T] {
    def write(obj: T): JValue = writer.write(obj)
    def readEither(value: JValue) = reader.readEither(value)
  }
}

@implicitNotFound(
  "No Json formatter found for type ${T}. Try to implement an implicit JsonFormat for this type."
)
trait JsonFormat[T] extends Writer[T] with Reader[T]
trait BigDecimalJsonFormats extends DefaultJsonFormats with DefaultReaders with BigDecimalWriters
trait DoubleJsonFormats extends DefaultJsonFormats with DefaultReaders with DoubleWriters
object BigDecimalJsonFormats extends BigDecimalJsonFormats
object DoubleJsonFormats extends DoubleJsonFormats
object DefaultJsonFormats extends DoubleJsonFormats
trait DefaultJsonFormats extends DefaultReaders




© 2015 - 2024 Weber Informatics LLC | Privacy Policy