Trait

play.api.libs.json

DefaultWrites

Related Doc: package json

Permalink

trait DefaultWrites extends LowPriorityWrites

Default Serializers.

Source
Writes.scala
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DefaultWrites
  2. LowPriorityWrites
  3. EnvWrites
  4. AnyRef
  5. 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
    EnvWrites

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.

  5. implicit object BigIntWrites extends Writes[BigInt]

    Permalink

    Serializer for BigInt type.

  6. implicit object BigIntegerWrites extends Writes[BigInteger]

    Permalink

    Serializer for BigInteger type.

  7. implicit object BooleanWrites extends Writes[Boolean]

    Permalink

    Serializer for Boolean types.

  8. implicit object ByteWrites extends Writes[Byte]

    Permalink

    Serializer for Byte types.

  9. implicit object DefaultDateWrites extends Writes[Date]

    Permalink

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

  10. 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
    EnvWrites
  11. 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
    EnvWrites
  12. 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
    EnvWrites
  13. implicit val DefaultLocalTimeWrites: Writes[LocalTime]

    Permalink

    The default typeclass to write a java.time.LocalTime, using '10:15:30' format.

    The default typeclass to write a java.time.LocalTime, using '10:15:30' format.

    Definition Classes
    EnvWrites
  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
    EnvWrites
  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
    EnvWrites
  16. implicit object DoubleWrites extends Writes[Double]

    Permalink

    Serializer for Double types.

  17. implicit object FloatWrites extends Writes[Float]

    Permalink

    Serializer for Float types.

  18. val InstantEpochMilliWrites: Writes[Instant]

    Permalink

    Serializer for java.time.Instant as JSON number.

    Serializer for java.time.Instant as JSON number. The number of milliseconds since epoch is used.

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

    Permalink

    Serializer for Int types.

  20. implicit object JsValueWrites extends Writes[JsValue]

    Permalink

    Serializer for JsValues.

  21. implicit object JsonNodeWrites extends Writes[JsonNode]

    Permalink

    Serializer for Jackson JsonNode

    Serializer for Jackson JsonNode

    Definition Classes
    EnvWrites
  22. val LocalDateEpochMilliWrites: Writes[LocalDate]

    Permalink

    Serializer for java.time.LocalDate as JSON number.

    Serializer for java.time.LocalDate as JSON number. The number of milliseconds since epoch is used.

    import java.time.LocalDate
    import play.api.libs.json.Writes
    
    implicit val ldnWrites = Writes.LocalDateEpochMilliWrites
    Definition Classes
    EnvWrites
  23. val LocalDateTimeEpochMilliWrites: Writes[LocalDateTime]

    Permalink

    Serializer for java.time.LocalDateTime as JSON number.

    Serializer for java.time.LocalDateTime as JSON number. The number of milliseconds since epoch is used.

    import java.time.LocalDateTime
    import play.api.libs.json.Writes
    
    implicit val ldtnWrites = Writes.LocalDateTimeEpochMilliWrites
    Definition Classes
    EnvWrites
  24. val LocalTimeNanoOfDayWrites: Writes[LocalTime]

    Permalink

    Serializer for java.time.LocalTime as JSON number.

    Serializer for java.time.LocalTime as JSON number. The nano of day is written.

    import java.time.LocalTime
    import play.api.libs.json.Writes
    
    implicit val ltnWrites = Writes.LocalTimeNumberWrites
    Definition Classes
    EnvWrites
  25. implicit object LongWrites extends Writes[Long]

    Permalink

    Serializer for Long types.

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

    Permalink

    Serializer for Option.

  27. implicit object ShortWrites extends Writes[Short]

    Permalink

    Serializer for Short types.

  28. implicit object StringWrites extends Writes[String]

    Permalink

    Serializer for String types.

  29. object TemporalFormatter

    Permalink

    Formatting companion

    Formatting companion

    Definition Classes
    EnvWrites
  30. implicit object UuidWrites extends Writes[UUID]

    Permalink

    Serializer for java.util.UUID

  31. implicit val ZoneIdWrites: Writes[ZoneId]

    Permalink

    Serializer for java.time.ZoneId as JSON string.

    Serializer for java.time.ZoneId as JSON string.

    Definition Classes
    EnvWrites
  32. val ZonedDateTimeEpochMilliWrites: Writes[ZonedDateTime]

    Permalink

    Serializer for java.time.ZonedDateTime as JSON number.

    Serializer for java.time.ZonedDateTime as JSON number. The number of milliseconds since epoch is used.

    import java.time.ZonedDateTime
    import play.api.libs.json.Writes
    
    implicit val zdtnWrites = Writes.ZonedDateTimeEpochMilliWrites
    Definition Classes
    EnvWrites
  33. implicit def arrayWrites[T](implicit arg0: ClassTag[T], arg1: Writes[T]): Writes[Array[T]]

    Permalink

    Serializer for Array[T] types.

  34. final def asInstanceOf[T0]: T0

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. def dateWrites(pattern: String): Writes[Date]

    Permalink

    Serializer for java.util.Date

    Serializer for java.util.Date

    pattern

    the pattern used by SimpleDateFormat

  37. implicit def enumNameWrites[E <: Enumeration]: Writes[enumNameWrites.E.Value]

    Permalink

    Serializer for scala.Enumeration by name.

  38. final def eq(arg0: AnyRef): Boolean

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

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

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

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

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

    Permalink
    Definition Classes
    Any
  44. val javaDurationMillisWrites: Writes[Duration]

    Permalink

    Serializer of Java Duration as a number of milliseconds.

    Serializer of Java Duration as a number of milliseconds.

    Definition Classes
    EnvWrites
  45. implicit val javaDurationWrites: Writes[Duration]

    Permalink

    Serializer of Java Duration using ISO representation (e.g.

    Serializer of Java Duration using ISO representation (e.g. PT1S for 1 second).

    Definition Classes
    EnvWrites
  46. implicit val javaPeriodWrites: Writes[Period]

    Permalink

    Serializer of Java Period using ISO representation (e.g.

    Serializer of Java Period using ISO representation (e.g. P2D for 2 days).

    Definition Classes
    EnvWrites
  47. val localeObjectWrites: OWrites[Locale]

    Permalink

    Serializer for a Locale using a object representation

    Serializer for a Locale using a object representation

    Definition Classes
    EnvWrites
  48. implicit val localeWrites: Writes[Locale]

    Permalink

    Serializer for a Locale using the IETF BCP 47 string representation

    Serializer for a Locale using the IETF BCP 47 string representation

    Definition Classes
    EnvWrites
  49. implicit def mapWrites[V](implicit arg0: Writes[V]): OWrites[Map[String, V]]

    Permalink

    Serializer for Map[String,V] types.

  50. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  53. def sqlDateWrites(pattern: String): Writes[Date]

    Permalink

    Serializer for java.sql.Date

    Serializer for java.sql.Date

    pattern

    the pattern used by SimpleDateFormat

  54. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  55. 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
    EnvWrites
  56. def toString(): String

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

    Permalink

    Serializer for Traversables types.

    Serializer for Traversables types.

    Definition Classes
    LowPriorityWrites
  58. final def wait(): Unit

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

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

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

Deprecated Value Members

  1. object DefaultJodaDateWrites extends Writes[DateTime]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.JodaDateNumberWrites

  2. object DefaultJodaLocalDateWrites extends Writes[LocalDate]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.DefaultJodaLocalDateWrites

  3. object DefaultJodaLocalTimeWrites extends Writes[LocalTime]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.DefaultJodaLocalTimeWrites

  4. def jodaDateWrites(pattern: String): Writes[DateTime]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.jodaDateWrites

  5. def jodaLocalDateWrites(pattern: String): Writes[LocalDate]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.jodaLocalDateWrites

  6. def jodaLocalTimeWrites(pattern: String): Writes[LocalTime]

    Permalink
    Definition Classes
    EnvWrites
    Annotations
    @deprecated
    Deprecated

    (Since version 2.6.0) Include play-json-joda as a dependency and use JodaWrites.jodaLocalTimeWrites

Inherited from LowPriorityWrites

Inherited from EnvWrites

Inherited from AnyRef

Inherited from Any

Ungrouped