Package

net.liftweb

json

Permalink

package json

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. json
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Visibility
  1. Public
  2. All

Type Members

  1. class CustomSerializer[A] extends Serializer[A]

    Permalink
  2. trait DateFormat extends AnyRef

    Permalink

    Conversions between String and Date.

  3. trait DefaultFormats extends Formats

    Permalink
  4. case class Diff(changed: JValue, added: JValue, deleted: JValue) extends Product with Serializable

    Permalink

    A difference between two JSONs (j1 diff j2).

    A difference between two JSONs (j1 diff j2).

    changed

    what has changed from j1 to j2

    added

    what has been added to j2

    deleted

    what has been deleted from j1

  5. case class FieldSerializer[A](serializer: PartialFunction[(String, Any), Option[(String, Any)]] = Map(), deserializer: PartialFunction[JField, JField] = Map())(implicit evidence$1: Manifest[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")
    )
    

  6. trait Formats extends AnyRef

    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 = net.liftweb.json.DefaultFormats
    

  7. case class FullTypeHints(hints: List[Class[_]]) extends TypeHints with Product with Serializable

    Permalink

    Use full class name as a type hint.

  8. trait Implicits extends AnyRef

    Permalink
  9. type JArray = json.JsonAST.JArray

    Permalink
  10. type JBool = json.JsonAST.JBool

    Permalink
  11. type JDouble = json.JsonAST.JDouble

    Permalink
  12. type JField = json.JsonAST.JField

    Permalink
  13. type JInt = json.JsonAST.JInt

    Permalink
  14. type JObject = json.JsonAST.JObject

    Permalink
  15. type JString = json.JsonAST.JString

    Permalink
  16. type JValue = json.JsonAST.JValue

    Permalink
  17. trait JsonDSL extends Implicits

    Permalink
  18. case class MappingException(msg: String, cause: Exception) extends Exception with Product with Serializable

    Permalink
  19. trait ParameterNameReader extends AnyRef

    Permalink
  20. trait Serializer[A] extends AnyRef

    Permalink
  21. case class ShortTypeHints(hints: List[Class[_]]) extends TypeHints with Product with Serializable

    Permalink

    Use short class name as a type hint.

  22. 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 = DefaultFormats.withHints(hints)
    

  23. case class TypeInfo(clazz: Class[_], parameterizedType: Option[ParameterizedType]) extends Product with Serializable

    Permalink
  24. trait Printer extends AnyRef

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Please switch using JsonAST's render methods instead of relying on Printer.

Value Members

  1. object DefaultFormats extends DefaultFormats

    Permalink

    Default date format is UTC time.

  2. object Diff extends Serializable

    Permalink

    Computes a diff between two JSONs.

  3. 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

  4. object FieldSerializer extends Serializable

    Permalink
  5. object Implicits extends Implicits

    Permalink

    Basic implicit conversions from primitive types into JSON.

    Basic implicit conversions from primitive types into JSON. Example:

    import net.liftweb.json.Implicits._
    JObject(JField("name", "joe") :: Nil) == JObject(JField("name", JString("joe")) :: Nil)
    

  6. val JArray: json.JsonAST.JArray.type

    Permalink
  7. val JBool: json.JsonAST.JBool.type

    Permalink
  8. val JDouble: json.JsonAST.JDouble.type

    Permalink
  9. val JField: json.JsonAST.JField.type

    Permalink
  10. val JInt: json.JsonAST.JInt.type

    Permalink
  11. val JNothing: json.JsonAST.JNothing.type

    Permalink
  12. val JNull: json.JsonAST.JNull.type

    Permalink
  13. val JObject: json.JsonAST.JObject.type

    Permalink
  14. val JString: json.JsonAST.JString.type

    Permalink
  15. object JsonAST

    Permalink

    This object contains the abstract syntax tree (or AST) for working with JSON objects in lift-json.

    This object contains the abstract syntax tree (or AST) for working with JSON objects in lift-json.

    The purpose of the JSON AST is to represent and manipulate JSON by leveraging Scala language features like types, case classes, etc. The AST should allow you to represent anything you could imagine from JSON land using the Scala type system.

    Everything in the AST has a single root: JValue. A JValue could, quite literally, be anything. It could be an an object (represented by JObject), a string (JString), a null (JNull), and so on. So, when constructing a JSON object with the AST directly you might construct something like the following:

    JObject(JField("bacon", JBool(true)) :: JField("spinach", JBool(false)))

    Once serialized to the string representation of JSON you would end up with the following:

    {
      "bacon":true,
      "spinach":false
    }
  16. object JsonDSL extends JsonDSL

    Permalink

    A DSL to produce valid JSON.

    A DSL to produce valid JSON. Example:

    import net.liftweb.json.JsonDSL._
    ("name", "joe") ~ ("age", 15) == JObject(JField("name",JString("joe")) :: JField("age",JInt(15)) :: Nil)
    

  17. object JsonParser

    Permalink

    JSON parser.

  18. object Merge

    Permalink

    Function to merge two JSONs.

  19. object NoTypeHints extends TypeHints with Product with Serializable

    Permalink

    Do not use any type hints.

  20. object Serialization

    Permalink

    Functions to serialize and deserialize a case class.

    Functions to serialize and deserialize a case class. Custom serializer can be inserted if a class is not a case class.

    Example:

    val hints = new ShortTypeHints( ... )
    implicit val formats = Serialization.formats(hints)
    

    See also

    net.liftweb.json.TypeHints

  21. object Xml

    Permalink

    Functions to convert between JSON and XML.

  22. def compactRender(value: JValue): String

    Permalink
  23. package ext

    Permalink
  24. def parse(s: String): JValue

    Permalink
  25. def parseOpt(s: String): Option[JValue]

    Permalink
  26. def prettyRender(value: JValue): String

    Permalink
  27. package scalaz

    Permalink

Deprecated Value Members

  1. object Printer extends Printer

    Permalink

    Printer converts JSON to String.

    Printer converts JSON to String. Before printing a JValue needs to be rendered into scala.text.Document.

    Example:

    pretty(render(json))
    

    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Please switch using JsonAST's render methods instead of relying on Printer.

  2. def compact(d: RenderIntermediaryDocument): String

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Please switch to using compactRender instead.

  3. def pretty(d: RenderIntermediaryDocument): String

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Please switch to using prettyRender instead.

  4. def render(value: JValue): RenderIntermediaryDocument

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 3.0) Please switch to using prettyRender or compactRender instead.

Inherited from AnyRef

Inherited from Any

Ungrouped