Default Serializers.
Attributes
- Companion
- trait
- Graph
-
- Supertypes
-
trait GeneratedWritestrait DefaultWritestrait LowPriorityWritestrait EnvWritestrait ConstraintWritestrait PathWritesclass Objecttrait Matchableclass AnyShow all
- Self type
-
Writes.type
Members list
Type members
Inherited classlikes
Serializer for BigDecimal types.
Serializer for BigInt type.
Serializer for BigInteger type.
Serializer for Boolean types.
Serializer for Byte types.
Serializer for Double types.
Serializer for Float types.
Serializer for Int types.
Serializer for Long types.
Serializer for Short types.
Serializer for String types.
Serializer for java.util.UUID
Deprecated and Inherited classlikes
Attributes
- Deprecated
- true
- Inherited from:
- DefaultWrites
- Supertypes
Attributes
- Deprecated
- true
- Inherited from:
- DefaultWrites
- Supertypes
Value members
Concrete methods
Returns an instance which uses f
as Writes.writes function.
Transforms the resulting JsValue using the given function, which is also applied with the initial input. def transform(transformer: (A, JsValue) => JsValue): Writes[A] = Writes[A] { a => transformer(a, this.writes(a)) }
Transforms the resulting JsValue using the given function, which is also applied with the initial input. def transform(transformer: (A, JsValue) => JsValue): Writes[A] = Writes[A] { a => transformer(a, this.writes(a)) }
Value parameters
- f
-
the transformer function
- w
-
the initial writer
Attributes
Inherited methods
Attributes
- Inherited from:
- PathWrites
Serializer for java.util.Date
Serializer for java.util.Date
Value parameters
- pattern
-
the pattern used by SimpleDateFormat
Attributes
- Inherited from:
- DefaultWrites
Attributes
- Inherited from:
- PathWrites
Attributes
- Inherited from:
- PathWrites
Attributes
- Inherited from:
- PathWrites
Attributes
- Inherited from:
- ConstraintWrites
Attributes
- Inherited from:
- ConstraintWrites
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]
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]
Attributes
- Inherited from:
- PathWrites
Attributes
- Inherited from:
- ConstraintWrites
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
Attributes
- Inherited from:
- ConstraintWrites
Attributes
- Inherited from:
- ConstraintWrites
Attributes
- Inherited from:
- ConstraintWrites
Attributes
- Inherited from:
- PathWrites
Attributes
- Inherited from:
- ConstraintWrites
Attributes
- Inherited from:
- ConstraintWrites
Deprecated and Inherited methods
Serializer for Iterable types.
Serializer for Iterable types.
Deprecated due to incompatibility with non _[_]
shapes, #368.
Attributes
- Deprecated
- true
- Inherited from:
- LowPriorityWrites
Attributes
- Deprecated
- true
- Inherited from:
- ConstraintWrites
Serializer for java.sql.Date
Serializer for java.sql.Date
Value parameters
- pattern
-
the pattern used by SimpleDateFormat
Attributes
- Deprecated
- true
- Inherited from:
- DefaultWrites
Attributes
- Deprecated
- true
- Inherited from:
- LowPriorityWrites
Givens
Inherited givens
Serializer for scala.Enumeration by name.
Serializer for scala.Enumeration by name.
Attributes
- Inherited from:
- EnumerationWrites (hidden)
Implicits
Implicits
Inherited implicits
Serializer for JsNull.
Serializer for JsNull.
import play.api.libs.json.Json
Json.obj("foo" -> None)
// equivalent to Json.obj("foo" -> JsNull)
Attributes
- Inherited from:
- DefaultWrites
Serializer for Option.
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Attributes
- Inherited from:
- GeneratedWrites
Serializer for Array[T] types.
Default Serializer java.util.Date -> JsNumber(d.getTime (nb of ms))
Default Serializer java.util.Date -> JsNumber(d.getTime (nb of ms))
Attributes
- Inherited from:
- DefaultWrites
Serializer for Map[String,V] types.
Serializer for Iterable types.
Serializer for JsValues.
Attributes
- Inherited from:
- DefaultWrites
Serializer for scala.collection.immutable.Range (aka specialized Seq
of Int
).
Serializer for scala.collection.immutable.Range (aka specialized Seq
of Int
).
Attributes
- Inherited from:
- DefaultWrites
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
- Inherited from:
- DefaultWrites
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
Serializer for java.net.URI
Deprecated and Inherited implicits
Serializer for Map[String,V] types.