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

org.json4sbt.JsonMethods.scala Maven / Gradle / Ivy

The newest version!
package org.json4sbt

import java.io.{Reader => JReader, File, InputStream}

sealed abstract class JsonInput extends Product with Serializable
case class StringInput(string: String) extends JsonInput
case class ReaderInput(reader: JReader) extends JsonInput
case class StreamInput(stream: InputStream) extends JsonInput
case class FileInput(file: File) extends JsonInput


trait JsonMethods[T] {

  def parse(in: JsonInput, useBigDecimalForDouble: Boolean = false, useBigIntForLong: Boolean = true): JValue
  def parseOpt(in: JsonInput, useBigDecimalForDouble: Boolean = false, useBigIntForLong: Boolean = true): Option[JValue]

  def render(value: JValue)(implicit formats: Formats = DefaultFormats): T
  def compact(d: T): String
  def pretty(d: T): String
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy