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

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

The 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 - 2025 Weber Informatics LLC | Privacy Policy