p

org

json4s

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]
  2. class CustomSerializer[A] extends Serializer[A]
  3. trait DateFormat extends AnyRef

    Conversions between String and Date.

  4. trait DefaultFormats extends Formats
  5. final class ExtractableJsonAstNode extends AnyVal
  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

    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

    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

    Use full class name as a type hint.

  9. type JField = (String, json4s.JsonAST.JValue)
  10. abstract class JsonUtil extends AnyRef
  11. trait KeySerializer[A] extends AnyRef
  12. case class MappedTypeHints(hintMap: Map[Class[_], String], typeHintFieldName: String = "jsonClass") extends TypeHints with Product with Serializable

    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
  14. trait RichSerializer[A] extends AnyRef
  15. trait Serialization extends AnyRef
  16. trait Serializer[A] extends AnyRef
  17. case class ShortTypeHints(hints: List[Class[_]], typeHintFieldName: String = "jsonClass") extends TypeHints with Product with Serializable

    Use short class name as a type hint.

  18. trait TypeHints extends AnyRef

    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

Value Members

  1. val TypeInfo: json4s.reflect.TypeInfo.type
  2. implicit def convertToJsonInput[A](input: A)(implicit arg0: AsJsonInput[A]): JsonInput
  3. implicit def jsonwritable[T](a: T)(implicit arg0: Writer[T]): ToJsonWritable[T]
  4. implicit def jvalue2extractable(jv: JValue): ExtractableJsonAstNode
  5. implicit def jvalue2monadic(jv: JValue): MonadicJValue
  6. implicit def jvalue2readerSyntax(j: JValue): ReaderSyntax
  7. object DefaultFormats extends DefaultFormats

    Default date format is UTC time.

  8. object Extraction

    Function to extract values from JSON AST using case classes.

    Function to extract values from JSON AST using case classes.

    See: ExtractionExamples.scala

  9. object FieldSerializer extends Serializable
  10. object Formats extends Serializable
  11. object NoTypeHints extends TypeHints with Product with Serializable

    Do not use any type hints.

Inherited from AnyRef

Inherited from Any

Ungrouped