Object/Trait

play.api.libs.json

Writes

Related Docs: trait Writes | package json

Permalink

object Writes extends PathWrites with ConstraintWrites with DefaultWrites

Default Serializers.

Source
Writes.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Writes
  2. DefaultWrites
  3. ConstraintWrites
  4. PathWrites
  5. AnyRef
  6. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. trait TemporalFormatter[T <: Temporal] extends AnyRef

    Permalink

    Typeclass to implement way of formatting of Java8 temporal types.

    Typeclass to implement way of formatting of Java8 temporal types.

    Definition Classes
    DefaultWrites

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. implicit object BigDecimalWrites extends Writes[BigDecimal]

    Permalink

    Serializer for BigDecimal types.

    Serializer for BigDecimal types.

    Definition Classes
    DefaultWrites
  5. implicit object BooleanWrites extends Writes[Boolean]

    Permalink

    Serializer for Boolean types.

    Serializer for Boolean types.

    Definition Classes
    DefaultWrites
  6. implicit object ByteWrites extends Writes[Byte]

    Permalink

    Serializer for Byte types.

    Serializer for Byte types.

    Definition Classes
    DefaultWrites
  7. implicit object DefaultDateWrites extends Writes[Date]

    Permalink

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

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

    Definition Classes
    DefaultWrites
  8. implicit val DefaultInstantWrites: Writes[Instant]

    Permalink

    The default typeclass to write a java.time.Instant, using '2011-12-03T10:15:30Z' format.

    The default typeclass to write a java.time.Instant, using '2011-12-03T10:15:30Z' format.

    Definition Classes
    DefaultWrites
  9. implicit object DefaultJodaDateWrites extends Writes[DateTime]

    Permalink

    Default Serializer org.joda.time.DateTime -> JsNumber(d.getMillis (nb of ms))

    Default Serializer org.joda.time.DateTime -> JsNumber(d.getMillis (nb of ms))

    Definition Classes
    DefaultWrites
  10. implicit object DefaultJodaLocalDateWrites extends Writes[LocalDate]

    Permalink

    Default Serializer org.joda.time.LocalDate -> JsString(ISO8601 format (yyyy-MM-dd))

    Default Serializer org.joda.time.LocalDate -> JsString(ISO8601 format (yyyy-MM-dd))

    Definition Classes
    DefaultWrites
  11. implicit object DefaultJodaLocalTimeWrites extends Writes[LocalTime]

    Permalink

    Default Serializer org.joda.time.LocalDate -> JsString(ISO8601 format (HH:mm:ss.SSS))

    Default Serializer org.joda.time.LocalDate -> JsString(ISO8601 format (HH:mm:ss.SSS))

    Definition Classes
    DefaultWrites
  12. implicit val DefaultLocalDateTimeWrites: Writes[LocalDateTime]

    Permalink

    The default typeclass to write a java.time.LocalDateTime, using '2011-12-03T10:15:30' format.

    The default typeclass to write a java.time.LocalDateTime, using '2011-12-03T10:15:30' format.

    Definition Classes
    DefaultWrites
  13. implicit val DefaultLocalDateWrites: Writes[LocalDate]

    Permalink

    The default typeclass to write a java.time.LocalDate, using '2011-12-03' format.

    The default typeclass to write a java.time.LocalDate, using '2011-12-03' format.

    Definition Classes
    DefaultWrites
  14. implicit val DefaultOffsetDateTimeWrites: Writes[OffsetDateTime]

    Permalink

    The default typeclass to write a java.time.OffsetDateTime, using '2011-12-03T10:15:30+02:00' format.

    The default typeclass to write a java.time.OffsetDateTime, using '2011-12-03T10:15:30+02:00' format.

    Definition Classes
    DefaultWrites
  15. implicit val DefaultZonedDateTimeWrites: Writes[ZonedDateTime]

    Permalink

    The default typeclass to write a java.time.ZonedDateTime, using '2011-12-03T10:15:30+01:00[Europe/Paris]' format.

    The default typeclass to write a java.time.ZonedDateTime, using '2011-12-03T10:15:30+01:00[Europe/Paris]' format.

    Definition Classes
    DefaultWrites
  16. implicit object DoubleWrites extends Writes[Double]

    Permalink

    Serializer for Double types.

    Serializer for Double types.

    Definition Classes
    DefaultWrites
  17. implicit object FloatWrites extends Writes[Float]

    Permalink

    Serializer for Float types.

    Serializer for Float types.

    Definition Classes
    DefaultWrites
  18. val InstantNumberWrites: Writes[Instant]

    Permalink

    Serializer for java.time.Instant as JSON number.

    Serializer for java.time.Instant as JSON number.

    import java.time.Instant
    import play.api.libs.json.Writes
    
    implicit val inWrites = Writes.InstantNumberWrites
    Definition Classes
    DefaultWrites
  19. implicit object IntWrites extends Writes[Int]

    Permalink

    Serializer for Int types.

    Serializer for Int types.

    Definition Classes
    DefaultWrites
  20. implicit object JsValueWrites extends Writes[JsValue]

    Permalink

    Serializer for JsValues.

    Serializer for JsValues.

    Definition Classes
    DefaultWrites
  21. implicit object JsonNodeWrites extends Writes[JsonNode]

    Permalink

    Serializer for Jackson JsonNode

    Serializer for Jackson JsonNode

    Definition Classes
    DefaultWrites
  22. val LocalDateNumberWrites: Writes[LocalDate]

    Permalink

    Serializer for java.time.LocalDate as JSON number.

    Serializer for java.time.LocalDate as JSON number.

    import java.time.LocalDate
    import play.api.libs.json.Writes
    
    implicit val ldnWrites = Writes.LocalDateNumberWrites
    Definition Classes
    DefaultWrites
  23. val LocalDateTimeNumberWrites: Writes[LocalDateTime]

    Permalink

    Serializer for java.time.LocalDateTime as JSON number.

    Serializer for java.time.LocalDateTime as JSON number.

    import java.time.LocalDateTime
    import play.api.libs.json.Writes
    
    implicit val ldtnWrites = Writes.LocalDateTimeNumberWrites
    Definition Classes
    DefaultWrites
  24. implicit object LongWrites extends Writes[Long]

    Permalink

    Serializer for Long types.

    Serializer for Long types.

    Definition Classes
    DefaultWrites
  25. implicit def OptionWrites[T](implicit fmt: Writes[T]): Writes[Option[T]]

    Permalink

    Serializer for Option.

    Serializer for Option.

    Definition Classes
    DefaultWrites
  26. implicit object ShortWrites extends Writes[Short]

    Permalink

    Serializer for Short types.

    Serializer for Short types.

    Definition Classes
    DefaultWrites
  27. implicit object StringWrites extends Writes[String]

    Permalink

    Serializer for String types.

    Serializer for String types.

    Definition Classes
    DefaultWrites
  28. object TemporalFormatter

    Permalink

    Formatting companion

    Formatting companion

    Definition Classes
    DefaultWrites
  29. implicit object UuidWrites extends Writes[UUID]

    Permalink

    Serializer for java.util.UUID

    Serializer for java.util.UUID

    Definition Classes
    DefaultWrites
  30. val ZonedDateTimeNumberWrites: Writes[ZonedDateTime]

    Permalink

    Serializer for java.time.ZonedDateTime as JSON number.

    Serializer for java.time.ZonedDateTime as JSON number.

    import java.time.ZonedDateTime
    import play.api.libs.json.Writes
    
    implicit val zdtnWrites = Writes.ZonedDateTimeNumberWrites
    Definition Classes
    DefaultWrites
  31. def apply[A](f: (A) ⇒ JsValue): Writes[A]

    Permalink
  32. implicit def arrayWrites[T](implicit arg0: ClassTag[T], arg1: Writes[T]): Writes[Array[T]]

    Permalink

    Serializer for Array[T] types.

    Serializer for Array[T] types.

    Definition Classes
    DefaultWrites
  33. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  34. def at[A](path: JsPath)(implicit wrs: Writes[A]): OWrites[A]

    Permalink
    Definition Classes
    PathWrites
  35. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. val constraints: ConstraintWrites

    Permalink
  37. implicit val contravariantfunctorWrites: ContravariantFunctor[Writes]

    Permalink
  38. def dateWrites(pattern: String): Writes[Date]

    Permalink

    Serializer for java.util.Date

    Serializer for java.util.Date

    pattern

    the pattern used by SimpleDateFormat

    Definition Classes
    DefaultWrites
  39. implicit def enumNameWrites[E <: Enumeration]: Writes[DefaultWrites.enumNameWrites.E.Value]

    Permalink

    Serializer for scala.Enumeration by name.

    Serializer for scala.Enumeration by name.

    Definition Classes
    DefaultWrites
  40. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  42. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  43. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  44. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  45. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  46. def jodaDateWrites(pattern: String): Writes[DateTime]

    Permalink

    Serializer for org.joda.time.DateTime

    Serializer for org.joda.time.DateTime

    pattern

    the pattern used by SimpleDateFormat

    Definition Classes
    DefaultWrites
  47. def jodaLocalDateWrites(pattern: String): Writes[LocalDate]

    Permalink

    Serializer for org.joda.time.LocalDate

    Serializer for org.joda.time.LocalDate

    pattern

    the pattern used by org.joda.time.format.DateTimeFormat

    Definition Classes
    DefaultWrites
  48. def jodaLocalTimeWrites(pattern: String): Writes[LocalTime]

    Permalink

    Serializer for org.joda.time.LocalTime

    Serializer for org.joda.time.LocalTime

    pattern

    the pattern used by org.joda.time.format.DateTimeFormat

    Definition Classes
    DefaultWrites
  49. def jsPick(path: JsPath): Writes[JsValue]

    Permalink
    Definition Classes
    PathWrites
  50. def jsPickBranch(path: JsPath): OWrites[JsValue]

    Permalink
    Definition Classes
    PathWrites
  51. def jsPickBranchUpdate(path: JsPath, wrs: OWrites[JsValue]): OWrites[JsValue]

    Permalink
    Definition Classes
    PathWrites
  52. def list[A](implicit writes: Writes[A]): Writes[List[A]]

    Permalink
    Definition Classes
    ConstraintWrites
  53. def map[A](implicit writes: Writes[A]): OWrites[Map[String, A]]

    Permalink
    Definition Classes
    ConstraintWrites
  54. implicit def mapWrites[V](implicit arg0: Writes[V]): OWrites[Map[String, V]]

    Permalink

    Serializer for Map[String,V] types.

    Serializer for Map[String,V] types.

    Definition Classes
    DefaultWrites
  55. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  56. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  57. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  58. def nullable[A](path: JsPath)(implicit wrs: Writes[A]): OWrites[Option[A]]

    Permalink

    writes a optional field in given JsPath : if None, doesn't write field at all.

    writes a optional field in given JsPath : if None, doesn't write field at all. Please note we do not write "null" but simply omit the field when None If you want to write a "null", use ConstraintWrites.optionWithNull[A]

    Definition Classes
    PathWrites
  59. def of[A](implicit w: Writes[A]): Writes[A]

    Permalink
    Definition Classes
    ConstraintWrites
  60. def optionWithNull[A](implicit wa: Writes[A]): Writes[Option[A]]

    Permalink

    Pure Option Writer[T] which writes "null" when None which is different from JsPath.writeNullable which omits the field when None

    Pure Option Writer[T] which writes "null" when None which is different from JsPath.writeNullable which omits the field when None

    Definition Classes
    ConstraintWrites
  61. val path: PathWrites

    Permalink
  62. def pruned[A](implicit w: Writes[A]): Writes[A]

    Permalink
    Definition Classes
    ConstraintWrites
  63. def pure[A](fixed: ⇒ A)(implicit wrs: Writes[A]): Writes[JsValue]

    Permalink
    Definition Classes
    ConstraintWrites
  64. def pure[A](path: JsPath, fixed: ⇒ A)(implicit wrs: Writes[A]): OWrites[JsValue]

    Permalink
    Definition Classes
    PathWrites
  65. def seq[A](implicit writes: Writes[A]): Writes[Seq[A]]

    Permalink
    Definition Classes
    ConstraintWrites
  66. def set[A](implicit writes: Writes[A]): Writes[Set[A]]

    Permalink
    Definition Classes
    ConstraintWrites
  67. def sqlDateWrites(pattern: String): Writes[Date]

    Permalink

    Serializer for java.sql.Date

    Serializer for java.sql.Date

    pattern

    the pattern used by SimpleDateFormat

    Definition Classes
    DefaultWrites
  68. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  69. def temporalWrites[A <: Temporal, B](formatting: B)(implicit f: (B) ⇒ TemporalFormatter[A]): Writes[A]

    Permalink

    Serializer for Java8 temporal types (e.g.

    Serializer for Java8 temporal types (e.g. java.time.LocalDateTime) to be written as JSON string.

    A

    the Java8 temporal type to be considered: LocalDateTime, ZonedDateTime, Instant

    B

    Type of formatting argument

    formatting

    an argument to instantiate formatter

    import java.time.LocalDateTime
    import play.api.libs.json.Writes
    implicit val temporalWrites: Writes[LocalDateTime] =
      temporalWrites[LocalDateTime, DateTimeFormatter](
        DateTimeFormatter.ISO_LOCAL_DATE_TIME)
    Definition Classes
    DefaultWrites
  70. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  71. implicit def traversableWrites[A](implicit arg0: Writes[A]): Writes[Traversable[A]]

    Permalink

    Serializer for Traversables types.

    Serializer for Traversables types.

    Definition Classes
    DefaultWrites
  72. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  73. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  74. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DefaultWrites

Inherited from ConstraintWrites

Inherited from PathWrites

Inherited from AnyRef

Inherited from Any

Ungrouped