package json4s
- Alphabetic
- By Inheritance
- json4s
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Type Members
- trait BigDecimalJsonFormats extends DefaultJsonFormats with DefaultReaders with BigDecimalWriters
- trait BigDecimalWriters extends DefaultWriters
- class CustomKeySerializer [A] extends KeySerializer[A]
- class CustomSerializer [A] extends Serializer[A]
-
trait
DateFormat
extends AnyRef
Conversions between String and Date.
- trait DefaultFormats extends Formats
- trait DefaultJsonFormats extends AnyRef
- trait DefaultReaders extends AnyRef
- trait DefaultWriters extends AnyRef
- trait DoubleJsonFormats extends DefaultJsonFormats with DefaultReaders with DoubleWriters
- trait DoubleWriters extends DefaultWriters
- class DynamicJValue extends Dynamic
- trait DynamicJValueImplicits extends AnyRef
- class ExtractableJsonAstNode extends AnyRef
-
case class
FieldSerializer
[A](serializer: PartialFunction[(String, Any), Option[(String, Any)]] = Map(), deserializer: PartialFunction[JField, JField] = Map())(implicit mf: Manifest[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") )
- case class FileInput (file: File) extends JsonInput with Product with Serializable
-
trait
Formats
extends AnyRef
Formats to use when converting JSON.
Formats to use when converting JSON. Formats are usually configured by using an implicit parameter:
implicit val formats = org.json4s.DefaultFormats
- Annotations
- @implicitNotFound( ... )
-
case class
FullTypeHints
(hints: List[Class[_]]) extends TypeHints with Product with Serializable
Use full class name as a type hint.
- type JArray = json4s.JsonAST.JArray
- type JBool = json4s.JsonAST.JBool
- type JDecimal = json4s.JsonAST.JDecimal
- type JDouble = json4s.JsonAST.JDouble
- type JField = (String, json4s.JsonAST.JValue)
- type JInt = json4s.JsonAST.JInt
- type JObject = json4s.JsonAST.JObject
- type JString = json4s.JsonAST.JString
- type JValue = json4s.JsonAST.JValue
-
trait
JsonFormat
[T] extends Writer[T] with Reader[T]
- Annotations
- @implicitNotFound( ... )
- sealed trait JsonInput extends AnyRef
- trait JsonMethods [T] extends AnyRef
- abstract class JsonUtil extends AnyRef
- trait JsonWriter [T] extends AnyRef
- trait KeySerializer [A] extends AnyRef
- case class MappingException (msg: String, cause: Exception) extends Exception with Product with Serializable
- class MonadicJValue extends AnyRef
- trait ParameterNameReader extends json4s.reflect.ParameterNameReader
-
trait
Reader
[T] extends AnyRef
- Annotations
- @implicitNotFound( ... )
- case class ReaderInput (reader: java.io.Reader) extends JsonInput with Product with Serializable
- trait Serialization extends AnyRef
- trait Serializer [A] extends AnyRef
-
case class
ShortTypeHints
(hints: List[Class[_]]) extends TypeHints with Product with Serializable
Use short class name as a type hint.
- case class StreamInput (stream: InputStream) extends JsonInput with Product with Serializable
- case class StringInput (string: String) extends JsonInput with Product with Serializable
- class ToJsonWritable [T] extends AnyRef
-
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 = DefaultFormats.withHints(hints)
- type TypeInfo = json4s.reflect.TypeInfo
-
trait
Writer
[-T] extends AnyRef
- Annotations
- @implicitNotFound( ... )
Value Members
- val JArray: json4s.JsonAST.JArray.type
- val JBool: json4s.JsonAST.JBool.type
- val JDecimal: json4s.JsonAST.JDecimal.type
- val JDouble: json4s.JsonAST.JDouble.type
- val JField: json4s.JsonAST.JField.type
- val JInt: json4s.JsonAST.JInt.type
- val JNothing: json4s.JsonAST.JNothing.type
- val JNull: json4s.JsonAST.JNull.type
- val JObject: json4s.JsonAST.JObject.type
- val JString: json4s.JsonAST.JString.type
- val TypeInfo: json4s.reflect.TypeInfo.type
- implicit def file2JsonInput(file: File): JsonInput
- implicit def jsonwritable[T](a: T)(implicit arg0: Writer[T]): ToJsonWritable[T]
- implicit def jvalue2extractable(jv: JValue): ExtractableJsonAstNode
- implicit def jvalue2monadic(jv: JValue): MonadicJValue
- implicit def reader2JsonInput(rdr: java.io.Reader): JsonInput
- implicit def stream2JsonInput(stream: InputStream): JsonInput
- implicit def string2JsonInput(s: String): JsonInput
- object BigDecimalJsonFormats extends BigDecimalJsonFormats
- object BigDecimalWriters extends BigDecimalWriters
-
object
DefaultFormats
extends DefaultFormats
Default date format is UTC time.
- object DefaultJsonFormats extends DoubleJsonFormats
- object DefaultReaders extends DefaultReaders
- object DefaultWriters extends DoubleWriters
- object DoubleJsonFormats extends DoubleJsonFormats
- object DoubleWriters extends DoubleWriters
- object DynamicJValue extends DynamicJValueImplicits
-
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
- object FieldSerializer extends Serializable
- object Formats
- object JsonWriter
-
object
NoTypeHints
extends TypeHints with Product with Serializable
Do not use any type hints.
- object ParserUtil
-
object
Xml
Functions to convert between JSON and XML.