DefaultWrites

play.api.libs.json.DefaultWrites

Default Serializers.

Attributes

Graph
Supertypes
trait EnvWrites
class Object
trait Matchable
class Any
Known subtypes
object Writes.type

Members list

Type members

Classlikes

object BigDecimalWrites extends Writes[BigDecimal]

Serializer for BigDecimal types.

Serializer for BigDecimal types.

Attributes

Supertypes
trait Writes[BigDecimal]
class Object
trait Matchable
class Any
Self type
object BigIntWrites extends Writes[BigInt]

Serializer for BigInt type.

Serializer for BigInt type.

Attributes

Supertypes
trait Writes[BigInt]
class Object
trait Matchable
class Any
Self type
object BigIntegerWrites extends Writes[BigInteger]

Serializer for BigInteger type.

Serializer for BigInteger type.

Attributes

Supertypes
trait Writes[BigInteger]
class Object
trait Matchable
class Any
Self type
object BooleanWrites extends Writes[Boolean]

Serializer for Boolean types.

Serializer for Boolean types.

Attributes

Supertypes
trait Writes[Boolean]
class Object
trait Matchable
class Any
Self type
object ByteWrites extends Writes[Byte]

Serializer for Byte types.

Serializer for Byte types.

Attributes

Supertypes
trait Writes[Byte]
class Object
trait Matchable
class Any
Self type
ByteWrites.type
object DoubleWrites extends Writes[Double]

Serializer for Double types.

Serializer for Double types.

Attributes

Supertypes
trait Writes[Double]
class Object
trait Matchable
class Any
Self type
object FloatWrites extends Writes[Float]

Serializer for Float types.

Serializer for Float types.

Attributes

Supertypes
trait Writes[Float]
class Object
trait Matchable
class Any
Self type
object IntWrites extends Writes[Int]

Serializer for Int types.

Serializer for Int types.

Attributes

Supertypes
trait Writes[Int]
class Object
trait Matchable
class Any
Self type
IntWrites.type
object LongWrites extends Writes[Long]

Serializer for Long types.

Serializer for Long types.

Attributes

Supertypes
trait Writes[Long]
class Object
trait Matchable
class Any
Self type
LongWrites.type
object ShortWrites extends Writes[Short]

Serializer for Short types.

Serializer for Short types.

Attributes

Supertypes
trait Writes[Short]
class Object
trait Matchable
class Any
Self type
object StringWrites extends Writes[String]

Serializer for String types.

Serializer for String types.

Attributes

Supertypes
trait Writes[String]
class Object
trait Matchable
class Any
Self type
object UuidWrites extends Writes[UUID]

Serializer for java.util.UUID

Serializer for java.util.UUID

Attributes

Supertypes
trait Writes[UUID]
class Object
trait Matchable
class Any
Self type
UuidWrites.type

Deprecated classlikes

object DefaultDateWrites extends Writes[Date]

Attributes

Deprecated
true
Supertypes
trait Writes[Date]
class Object
trait Matchable
class Any
Self type
object JsValueWrites extends Writes[JsValue]

Attributes

Deprecated
true
Supertypes
trait Writes[JsValue]
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def dateWrites(pattern: String): Writes[Date]

Serializer for java.util.Date

Serializer for java.util.Date

Value parameters

pattern

the pattern used by SimpleDateFormat

Attributes

Deprecated methods

def sqlDateWrites(pattern: String): Writes[Date]

Serializer for java.sql.Date

Serializer for java.sql.Date

Value parameters

pattern

the pattern used by SimpleDateFormat

Attributes

Deprecated
true

Deprecated and Inherited methods

def iterableWrites[A, M <: (Iterable)](implicit w: Writes[A]): Writes[M[A]]

Serializer for Iterable types.

Serializer for Iterable types.

Deprecated due to incompatibility with non _[_] shapes, #368.

Attributes

Deprecated
true
Inherited from:
LowPriorityWrites
def traversableWrites[A : Writes]: Writes[Iterable[A]]

Attributes

Deprecated
true
Inherited from:
LowPriorityWrites

Givens

Inherited givens

given enumNameWrites[E <: Enumeration](using e: ValueOf[E]): Writes[Value]

Serializer for scala.Enumeration by name.

Serializer for scala.Enumeration by name.

Attributes

Inherited from:
EnumerationWrites (hidden)

Implicits

Implicits

implicit val NoneWrites: Writes[None.type]

Serializer for JsNull.

Serializer for JsNull.

import play.api.libs.json.Json

Json.obj("foo" -> None)
// equivalent to Json.obj("foo" -> JsNull)

Attributes

implicit def OptionWrites[T](implicit fmt: Writes[T]): Writes[Option[T]]

Serializer for Option.

Serializer for Option.

Attributes

implicit def arrayWrites[T : Writes]: Writes[Array[T]]

Serializer for Array[T] types.

Serializer for Array[T] types.

Attributes

implicit def defaultDateWrites[T <: Date]: Writes[T]

Default Serializer java.util.Date -> JsNumber(d.getTime (nb of ms))

Default Serializer java.util.Date -> JsNumber(d.getTime (nb of ms))

Attributes

implicit def genericMapWrites[V, M <: (Map)](implicit w: Writes[V]): OWrites[M[String, V]]

Serializer for Map[String,V] types.

Serializer for Map[String,V] types.

Attributes

implicit def jsValueWrites[T <: JsValue]: Writes[T]

Serializer for JsValues.

Serializer for JsValues.

Attributes

implicit def keyMapWrites[K : KeyWrites, V : Writes, M <: (Map)]: OWrites[M[K, V]]
implicit def rangeWrites[T <: Range]: Writes[T]

Serializer for scala.collection.immutable.Range (aka specialized Seq of Int).

Serializer for scala.collection.immutable.Range (aka specialized Seq of Int).

Attributes

implicit def someWrites[T](implicit w: Writes[T]): Writes[Some[T]]

If Some is directly used (not as Option).

If Some is directly used (not as Option).

import play.api.libs.json.{ Json, Writes }

def foo[T: Writes](writeableValue: T) =
 Json.obj("foo" -> Some(writeableValue))
 // equivalent to Json.obj("foo" -> writeableValue)

Attributes

Deprecated implicits

implicit def mapWrites[V : Writes]: OWrites[Map[String, V]]

Serializer for Map[String,V] types.

Serializer for Map[String,V] types.

Attributes

Deprecated
true

Inherited implicits

implicit def iterableWrites2[A, I](implicit ev: I <:< Iterable[A], w: Writes[A]): Writes[I]

Serializer for Iterable types.

Serializer for Iterable types.

Attributes

Inherited from:
LowPriorityWrites
implicit def stringableWrites[T](implicit conv: T => String): Writes[T]

Serializer for any type that is provided an implicit conversion to String (e.g. tagged types).

Serializer for any type that is provided an implicit conversion to String (e.g. tagged types).

Attributes

Inherited from:
LowPriorityWrites
implicit val uriWrites: Writes[URI]

Serializer for java.net.URI

Serializer for java.net.URI

Attributes

Inherited from:
LowPriorityWrites