net.liftweb

json

package json

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. json
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

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

  2. trait DateFormat extends AnyRef

    Conversions between String and Date.

  3. trait DefaultFormats extends Formats

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

    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

    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

    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

    Use full class name as a type hint.

  8. trait Implicits extends AnyRef

  9. type JArray = json.JsonAST.JArray

  10. type JBool = json.JsonAST.JBool

  11. type JDouble = json.JsonAST.JDouble

  12. type JField = json.JsonAST.JField

  13. type JInt = json.JsonAST.JInt

  14. type JObject = json.JsonAST.JObject

  15. type JString = json.JsonAST.JString

  16. type JValue = json.JsonAST.JValue

  17. trait JsonDSL extends Implicits

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

  19. trait ParameterNameReader extends AnyRef

  20. trait Printer extends AnyRef

  21. trait Serializer[A] extends AnyRef

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

    Use short class name as a type hint.

  23. 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)
    

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

Value Members

  1. object DefaultFormats extends DefaultFormats

    Default date format is UTC time.

  2. object Diff extends Serializable

    Computes a diff between two JSONs.

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

  4. object FieldSerializer extends Serializable

  5. object Implicits extends Implicits

    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

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

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

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

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

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

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

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

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

  15. object JsonAST

  16. object JsonDSL extends JsonDSL

    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

    JSON parser.

  18. object Merge

    Function to merge two JSONs.

  19. object NoTypeHints extends TypeHints with Product with Serializable

    Do not use any type hints.

  20. object Printer extends Printer

    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))
    

    See also

    net.liftweb.json.JsonAST#render

  21. object Serialization

    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

  22. object Xml

    Functions to convert between JSON and XML.

  23. def compact(d: Document): String

  24. def compactRender(value: JValue): String

  25. def parse(s: String): JValue

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

  27. def pretty(d: Document): String

  28. def render(value: JValue): Document

Inherited from AnyRef

Inherited from Any

Ungrouped