trait Formats extends Serializable
Formats to use when converting JSON. Formats are usually configured by using an implicit parameter:
implicit val formats: Formats = org.json4s.DefaultFormats
- Self Type
- Formats
- Annotations
- @implicitNotFound()
- Source
- Formats.scala
- Alphabetic
- By Inheritance
- Formats
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def dateFormat: DateFormat
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +[A](newSerializer: FieldSerializer[A]): Formats
Adds a field serializer for a given type to this formats.
- def +(newSerializer: KeySerializer[_]): Formats
Adds the specified custom key serializer to this formats.
- def +(newSerializer: Serializer[_]): Formats
Adds the specified custom serializer to this formats.
- def +(newSerializer: RichSerializer[_]): Formats
Adds the specified custom serializer to this formats.
- def +(extraHints: TypeHints): Formats
Adds the specified type hints to this formats.
- def ++(newSerializers: Iterable[Serializer[_]]): Formats
Adds the specified custom serializers to this formats.
- def -(serializer: Serializer[_]): Formats
Removes the specified custom serializer from this formats.
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def addKeySerializers(newKeySerializers: Iterable[KeySerializer[_]]): Formats
Adds the specified custom serializers to this formats.
- def alwaysEscapeUnicode: Boolean
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def companions: List[(Class[_], AnyRef)]
- def considerCompanionConstructors: Boolean
Setting to false preserves library's behavior prior to 3.6, where companion object constructors were only considered when deserializing if there were no primary constructors.
Setting to false preserves library's behavior prior to 3.6, where companion object constructors were only considered when deserializing if there were no primary constructors. Setting to true preserves the backwards-incompatible change made in 3.6 to always consider companion object constructors when deserializing (https://github.com/json4s/json4s/pull/487).
- def customKeySerializers: List[KeySerializer[_]]
- def customSerializers: List[Serializer[_]]
- def emptyValueStrategy: EmptyValueStrategy
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def extractionNullStrategy: ExtractionNullStrategy
- def fieldSerializers: List[(Class[_], FieldSerializer[_])]
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonStrict: Formats
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def parameterNameReader: reflect.ParameterNameReader
Parameter name reading strategy.
Parameter name reading strategy. By default 'paranamer' is used.
- def preservingEmptyValues: Formats
- def primitives: Set[Type]
- def richSerializers: List[RichSerializer[_]]
- def skippingEmptyValues: Formats
- def strict: Formats
- def strictArrayExtraction: Boolean
- def strictFieldDeserialization: Boolean
- def strictMapExtraction: Boolean
- def strictOptionParsing: Boolean
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def typeHints: TypeHints
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- def wantsBigDecimal: Boolean
- def wantsBigInt: Boolean
- def withBigDecimal: Formats
- def withBigInt: Formats
- def withCompanions(comps: (Class[_], AnyRef)*): Formats
- def withDouble: Formats
- def withEmptyValueStrategy(strategy: EmptyValueStrategy): Formats
- def withEscapeUnicode: Formats
- def withExtractionNullStrategy(strategy: ExtractionNullStrategy): Formats
- def withLong: Formats
- def withPre36DeserializationBehavior: Formats
Prior to 3.6 companion object constructors were only considered when deserializing if there were no primary constructors.
Prior to 3.6 companion object constructors were only considered when deserializing if there were no primary constructors. A backwards-incompatible change was made in 3.6 to always consider companion object constructors when deserializing (https://github.com/json4s/json4s/pull/487), and is the default setting (considerCompanionConstructors = true). This changes the setting to false to preserve pre-3.6 deserialization behavior.
- def withStrictArrayExtraction: Formats
- def withStrictFieldDeserialization: Formats
- def withStrictMapExtraction: Formats
- def withStrictOptionParsing: Formats
Deprecated Value Members
- def customDeserializer(implicit format: Formats): PartialFunction[(TypeInfo, JValue), Any]
- Annotations
- @deprecated
- Deprecated
(Since version 3.6.4) Use the internal methods in the companion object instead.
- def customKeyDeserializer(implicit format: Formats): PartialFunction[(TypeInfo, String), Any]
- Annotations
- @deprecated
- Deprecated
(Since version 3.6.4) Use the internal methods in the companion object instead.
- def customKeySerializer(implicit format: Formats): PartialFunction[Any, String]
- Annotations
- @deprecated
- Deprecated
(Since version 3.6.4) Use the internal methods in the companion object instead.
- def customSerializer(implicit format: Formats): PartialFunction[Any, JValue]
- Annotations
- @deprecated
- Deprecated
(Since version 3.6.4) Use the internal methods in the companion object instead.
- def disallowNull: Formats
- Annotations
- @deprecated
- Deprecated
(Since version 3.7.0) Use withNullExtractionStrategy instead