play.api.libs.json

DefaultWrites

Related Doc: package json

trait DefaultWrites extends AnyRef

Default Serializers.

Source
Writes.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DefaultWrites
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

    Typeclass to implement way of formatting of Java8 temporal types.

Value Members

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

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

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

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

    Serializer for BigDecimal types.

  5. implicit object BooleanWrites extends Writes[Boolean]

    Serializer for Boolean types.

  6. implicit object ByteWrites extends Writes[Byte]

    Serializer for Byte types.

  7. implicit object DefaultDateWrites extends Writes[Date]

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

  8. implicit val DefaultInstantWrites: Writes[Instant]

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

  9. implicit object DefaultJodaDateWrites extends Writes[DateTime]

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

  10. implicit object DefaultJodaLocalDateWrites extends Writes[LocalDate]

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

  11. implicit object DefaultJodaLocalTimeWrites extends Writes[LocalTime]

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

  12. implicit val DefaultLocalDateTimeWrites: Writes[LocalDateTime]

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

  13. implicit val DefaultLocalDateWrites: Writes[LocalDate]

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

  14. implicit val DefaultZonedDateTimeWrites: Writes[ZonedDateTime]

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

  15. implicit object DoubleWrites extends Writes[Double]

    Serializer for Double types.

  16. implicit object FloatWrites extends Writes[Float]

    Serializer for Float types.

  17. val InstantNumberWrites: Writes[Instant]

    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
  18. implicit object IntWrites extends Writes[Int]

    Serializer for Int types.

  19. implicit object JsValueWrites extends Writes[JsValue]

    Serializer for JsValues.

  20. implicit object JsonNodeWrites extends Writes[JsonNode]

    Serializer for Jackson JsonNode

  21. val LocalDateNumberWrites: Writes[LocalDate]

    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
  22. val LocalDateTimeNumberWrites: Writes[LocalDateTime]

    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
  23. implicit object LongWrites extends Writes[Long]

    Serializer for Long types.

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

    Serializer for Option.

  25. implicit object ShortWrites extends Writes[Short]

    Serializer for Short types.

  26. implicit object StringWrites extends Writes[String]

    Serializer for String types.

  27. object TemporalFormatter

    Formatting companion

  28. implicit object UuidWrites extends Writes[UUID]

    Serializer for java.util.UUID

  29. val ZonedDateTimeNumberWrites: Writes[ZonedDateTime]

    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
  30. implicit def arrayWrites[T](implicit arg0: ClassTag[T], fmt: Writes[T]): Writes[Array[T]]

    Serializer for Array[T] types.

  31. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  32. def clone(): AnyRef

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

    Serializer for java.util.Date

    Serializer for java.util.Date

    pattern

    the pattern used by SimpleDateFormat

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

    Serializer for scala.Enumeration by name.

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

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

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

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

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

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

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

    Serializer for org.joda.time.DateTime

    Serializer for org.joda.time.DateTime

    pattern

    the pattern used by SimpleDateFormat

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

    Serializer for org.joda.time.LocalDate

    Serializer for org.joda.time.LocalDate

    pattern

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

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

    Serializer for org.joda.time.LocalTime

    Serializer for org.joda.time.LocalTime

    pattern

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

  44. implicit def mapWrites[V](implicit fmtv: Writes[V]): OWrites[Map[String, V]]

    Serializer for Map[String,V] types.

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

    Definition Classes
    AnyRef
  46. final def notify(): Unit

    Definition Classes
    AnyRef
  47. final def notifyAll(): Unit

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

    Serializer for java.sql.Date

    Serializer for java.sql.Date

    pattern

    the pattern used by SimpleDateFormat

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

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

    Serializer for Java8 temporal types (e.g.

    Serializer for Java8 temporal types (e.g. java.time.LocalDateTime) to be written as JSON string, using the default time zone.

    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)
  51. def toString(): String

    Definition Classes
    AnyRef → Any
  52. implicit def traversableWrites[A](implicit arg0: Writes[A]): Writes[Traversable[A]] { def writes(as: Traversable[A]): play.api.libs.json.JsArray }

    Serializer for Traversables types.

  53. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped