Serialization

org.json4s.native.Serialization
object Serialization extends Serialization

Functions to serialize and deserialize a case class. Custom serializer can be inserted if a class is not a case class.

Example:

val hints = new ShortTypeHints( ... )
implicit val formats: Formats = Serialization.formats(hints)

Attributes

See also

org.json4s.TypeHints

Source
Serialization.scala
Graph
Supertypes
trait Serialization
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def read[A](json: JsonInput)(implicit formats: Formats, mf: Manifest[A]): A

Deserialize from a String.

Deserialize from a String.

Attributes

Source
Serialization.scala
def read[A](in: Reader)(implicit formats: Formats, mf: Manifest[A]): A

Deserialize from a Reader.

Deserialize from a Reader.

Attributes

Source
Serialization.scala
def write[A](a: A)(implicit formats: Formats): String

Serialize to String.

Serialize to String.

Attributes

Source
Serialization.scala
def write[A, W <: Writer](a: A, out: W)(implicit formats: Formats): W

Serialize to Writer.

Serialize to Writer.

Attributes

Source
Serialization.scala
def writePretty[A](a: A)(implicit formats: Formats): String

Serialize to String (pretty format).

Serialize to String (pretty format).

Attributes

Source
Serialization.scala
def writePretty[A, W <: Writer](a: A, out: W)(implicit formats: Formats): W

Serialize to Writer (pretty format).

Serialize to Writer (pretty format).

Attributes

Source
Serialization.scala
def writePrettyOld[A](a: A)(implicit formats: Formats): String

Serialize to String (pretty format).

Serialize to String (pretty format).

Attributes

Source
Serialization.scala
def writePrettyOld[A, W <: Writer](a: A, out: W)(implicit formats: Formats): W

Serialize to Writer (pretty format).

Serialize to Writer (pretty format).

Attributes

Source
Serialization.scala

Inherited methods

def formats(hints: TypeHints): Formats

Create Serialization formats with given type hints.

Create Serialization formats with given type hints.

Example:

val hints = new ShortTypeHints( ... )
implicit val formats: Formats = Serialization.formats(hints)

Attributes

Inherited from:
Serialization
Source
Serialization.scala
def read[A](json: String)(implicit formats: Formats, mf: Manifest[A]): A

Deserialize from a String.

Deserialize from a String.

Attributes

Inherited from:
Serialization
Source
Serialization.scala