Package

org

json4s

Permalink

package json4s

Source
package.scala
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. json4s
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class CustomKeySerializer[A] extends KeySerializer[A]

    Permalink
  2. class CustomSerializer[A] extends Serializer[A]

    Permalink
  3. trait DateFormat extends AnyRef

    Permalink

    Conversions between String and Date.

  4. trait DefaultFormats extends Formats

    Permalink
  5. final class ExtractableJsonAstNode extends AnyVal

    Permalink
  6. case class FieldSerializer[A](serializer: PartialFunction[(String, Any), Option[(String, Any)]] = Map(), deserializer: PartialFunction[JField, JField] = Map(), includeLazyVal: Boolean = false)(implicit mf: ClassTag[A]) extends Product with Serializable

    Permalink

    Serializer which serializes all fields of a class too.

    Serializer which serializes all fields of a class too.

    Serialization can be intercepted by giving two optional PartialFunctions as constructor parameters:

    FieldSerializer[WildDog](
      renameTo("name", "animalname") orElse ignore("owner"),
      renameFrom("animalname", "name")
    )
    

    The third optional parameter "includeLazyVal" determines if serializer will serialize/deserialize lazy val fields or not.

  7. trait Formats extends Serializable

    Permalink

    Formats to use when converting JSON.

    Formats to use when converting JSON. Formats are usually configured by using an implicit parameter:

    implicit val formats: Formats = org.json4s.DefaultFormats
    

    Annotations
    @implicitNotFound( ... )
  8. case class FullTypeHints(hints: List[Class[_]], typeHintFieldName: String = "jsonClass") extends TypeHints with Product with Serializable

    Permalink

    Use full class name as a type hint.

  9. type JField = (String, json4s.JsonAST.JValue)

    Permalink
  10. abstract class JsonUtil extends AnyRef

    Permalink
  11. trait KeySerializer[A] extends AnyRef

    Permalink
  12. case class MappedTypeHints(hintMap: Map[Class[_], String], typeHintFieldName: String = "jsonClass") extends TypeHints with Product with Serializable

    Permalink

    Use a map of keys as type hints.

    Use a map of keys as type hints. Values may not be mapped by multiple keys

  13. type ParameterNameReader = json4s.reflect.ParameterNameReader

    Permalink
  14. trait RichSerializer[A] extends AnyRef

    Permalink
  15. trait Serialization extends AnyRef

    Permalink
  16. trait Serializer[A] extends AnyRef

    Permalink
  17. case class ShortTypeHints(hints: List[Class[_]], typeHintFieldName: String = "jsonClass") extends TypeHints with Product with Serializable

    Permalink

    Use short class name as a type hint.

  18. trait TypeHints extends AnyRef

    Permalink

    Type hints can be used to alter the default conversion rules when converting Scala instances into JSON and vice versa.

    Type hints can be used to alter the default conversion rules when converting Scala instances into JSON and vice versa. Type hints must be used when converting class which is not supported by default (for instance when class is not a case class).

    Example:

    class DateTime(val time: Long)
    
    val hints = new ShortTypeHints(classOf[DateTime] :: Nil) {
      override def serialize: PartialFunction[Any, JObject] = {
        case t: DateTime => JObject(JField("t", JInt(t.time)) :: Nil)
      }
    
      override def deserialize: PartialFunction[(String, JObject), Any] = {
        case ("DateTime", JObject(JField("t", JInt(t)) :: Nil)) => new DateTime(t.longValue)
      }
    }
    implicit val formats: Formats = DefaultFormats.withHints(hints)
    

  19. type TypeInfo = json4s.reflect.TypeInfo

    Permalink

Value Members

  1. object DefaultFormats extends DefaultFormats

    Permalink

    Default date format is UTC time.

  2. object Extraction

    Permalink

    Function to extract values from JSON AST using case classes.

    Function to extract values from JSON AST using case classes.

    See: ExtractionExamples.scala

  3. object FieldSerializer extends Serializable

    Permalink
  4. object Formats extends Serializable

    Permalink
  5. object NoTypeHints extends TypeHints with Product with Serializable

    Permalink

    Do not use any type hints.

  6. val TypeInfo: json4s.reflect.TypeInfo.type

    Permalink
  7. implicit def convertToJsonInput[A](input: A)(implicit arg0: AsJsonInput[A]): JsonInput

    Permalink
  8. implicit def jsonwritable[T](a: T)(implicit arg0: Writer[T]): ToJsonWritable[T]

    Permalink
  9. implicit def jvalue2extractable(jv: JValue): ExtractableJsonAstNode

    Permalink
  10. implicit def jvalue2monadic(jv: JValue): MonadicJValue

    Permalink
  11. implicit def jvalue2readerSyntax(j: JValue): ReaderSyntax

    Permalink
  12. package prefs

    Permalink
  13. package reflect

    Permalink

Inherited from AnyRef

Inherited from Any

Ungrouped