net.liftweb.json.JsonAST

JField

case class JField(name: String, value: JValue) extends JValue with Product with Serializable

Linear Supertypes
Serializable, Serializable, Product, Equals, JValue, Diffable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. JField
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. JValue
  7. Diffable
  8. AnyRef
  9. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new JField(name: String, value: JValue)

Type Members

  1. type Values = (String, Values)

    Definition Classes
    JFieldJValue

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. def ++(other: JValue): JValue

    Concatenate with another JSON.

    Concatenate with another JSON. This is a concatenation monoid: (JValue, ++, JNothing)

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) ++ JArray(JInt(3) :: Nil) ==
    JArray(List(JInt(1), JInt(2), JInt(3)))
    

    Definition Classes
    JValue
  5. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  6. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  7. def \[A <: JValue](clazz: Class[A]): List[Values]

    XPath-like expression to query JSON fields by type.

    XPath-like expression to query JSON fields by type. Matches only fields on next level.

    Example:

    json \ classOf[JInt]
    

    Definition Classes
    JValue
  8. def \(nameToFind: String): JValue

    XPath-like expression to query JSON fields by name.

    XPath-like expression to query JSON fields by name. Matches only fields on next level.

    Example:

    json \ "name"
    

    Definition Classes
    JValue
  9. def \\[A <: JValue](clazz: Class[A]): List[Values]

    XPath-like expression to query JSON fields by type.

    XPath-like expression to query JSON fields by type. Returns all matching fields.

    Example:

    json \\ classOf[JInt]
    

    Definition Classes
    JValue
  10. def \\(nameToFind: String): JValue

    XPath-like expression to query JSON fields by name.

    XPath-like expression to query JSON fields by name. Returns all matching fields.

    Example:

    json \\ "name"
    

    Definition Classes
    JValue
  11. def apply(i: Int): JValue

    Return nth element from JSON.

    Return nth element from JSON. Meaningful only to JArray, JObject and JField. Returns JNothing for other types.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil)(1) == JInt(2)
    

    Definition Classes
    JFieldJValue
  12. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  13. def canEqual(arg0: Any): Boolean

    Definition Classes
    JField → Equals
  14. def children: List[JValue]

    Return direct child elements.

    Return direct child elements.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil).children == List(JInt(1), JInt(2))
    

    Definition Classes
    JValue
  15. def clone(): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  16. def diff(other: JValue): Diff

    Return a diff.

    Return a diff.

    Definition Classes
    Diffable
    See also

    net.liftweb.json.Diff#diff

  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    JField → Equals → AnyRef → Any
  19. def extract[A](implicit formats: Formats, mf: Manifest[A]): A

    Extract a value from a JSON.

    Extract a value from a JSON.

    Value can be:

    • case class
    • primitive (String, Boolean, Date, etc.)
    • supported collection type (List, Seq, Map[String, _], Set)
    • any type which has a configured custom deserializer

    Example:

    case class Person(name: String)
    JObject(JField("name", JString("joe")) :: Nil).extract[Person] == Person("joe")
    

    Definition Classes
    JValue
  20. def extractOpt[A](implicit formats: Formats, mf: Manifest[A]): Option[A]

    Extract a value from a JSON.

    Extract a value from a JSON.

    Value can be:

    • case class
    • primitive (String, Boolean, Date, etc.)
    • supported collection type (List, Seq, Map[String, _], Set)
    • any type which has a configured custom deserializer

    Example:

    case class Person(name: String)
    JObject(JField("name", JString("joe")) :: Nil).extractOpt[Person] == Some(Person("joe"))
    

    Definition Classes
    JValue
  21. def extractOrElse[A](default: ⇒ A)(implicit formats: Formats, mf: Manifest[A]): A

    Extract a value from a JSON using a default value.

    Extract a value from a JSON using a default value.

    Value can be:

    • case class
    • primitive (String, Boolean, Date, etc.)
    • supported collection type (List, Seq, Map[String, _], Set)
    • any type which has a configured custom deserializer

    Example:

    case class Person(name: String)
    JNothing.extractOrElse(Person("joe")) == Person("joe")
    

    Definition Classes
    JValue
  22. def filter(p: (JValue) ⇒ Boolean): List[JValue]

    Return a List of all elements which matches the given predicate.

    Return a List of all elements which matches the given predicate.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) filter { case JInt(x) => x > 1; case _ => false }
    

    Definition Classes
    JValue
  23. def finalize(): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  24. def find(p: (JValue) ⇒ Boolean): Option[JValue]

    Return the first element from JSON which matches the given predicate.

    Return the first element from JSON which matches the given predicate.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) find { _ == JInt(2) } == Some(JInt(2))
    

    Definition Classes
    JValue
  25. def fold[A](z: A)(f: (A, JValue) ⇒ A): A

    Return a combined value by folding over JSON by applying a function f for each element.

    Return a combined value by folding over JSON by applying a function f for each element. The initial value is z.

    Definition Classes
    JValue
  26. final def getClass(): java.lang.Class[_]

    Definition Classes
    AnyRef → Any
  27. def hashCode(): Int

    Definition Classes
    JField → AnyRef → Any
  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. def map(f: (JValue) ⇒ JValue): JValue

    Return a new JValue resulting from applying the given function f to each element in JSON.

    Return a new JValue resulting from applying the given function f to each element in JSON.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) map { case JInt(x) => JInt(x+1); case x => x }
    

    Definition Classes
    JValue
  30. val name: String

  31. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  32. final def notify(): Unit

    Definition Classes
    AnyRef
  33. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  34. def productArity: Int

    Definition Classes
    JField → Product
  35. def productElement(arg0: Int): Any

    Definition Classes
    JField → Product
  36. def productIterator: Iterator[Any]

    Definition Classes
    Product
  37. def productPrefix: String

    Definition Classes
    JField → Product
  38. def remove(p: (JValue) ⇒ Boolean): JValue

    Return a JSON where all elements matching the given predicate are removed.

    Return a JSON where all elements matching the given predicate are removed.

    Example:

    JArray(JInt(1) :: JInt(2) :: JNull :: Nil) remove { _ == JNull }
    

    Definition Classes
    JValue
  39. def replace(l: List[String], replacement: JValue): JValue

    Return a new JValue resulting from replacing the value at the specified field path with the replacement value provided.

    Return a new JValue resulting from replacing the value at the specified field path with the replacement value provided. This has no effect if the path is empty or if the value is not a JObject instance.

    Example:

    JObject(List(JField("foo", JObject(List(JField("bar", JInt(1))))))).replace("foo" :: "bar" :: Nil, JString("baz"))
    // returns JObject(List(JField("foo", JObject(List(JField("bar", JString("baz")))))))
    

    Definition Classes
    JValue
  40. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  41. def toOpt: Option[JValue]

    Definition Classes
    JValue
  42. def toString(): String

    Definition Classes
    JField → AnyRef → Any
  43. def transform(f: PartialFunction[JValue, JValue]): JValue

    Return a new JValue resulting from applying the given partial function f to each element in JSON.

    Return a new JValue resulting from applying the given partial function f to each element in JSON.

    Example:

    JArray(JInt(1) :: JInt(2) :: Nil) transform { case JInt(x) => JInt(x+1) }
    

    Definition Classes
    JValue
  44. val value: JValue

  45. def values: (String, Values)

    Return unboxed values from JSON

    Return unboxed values from JSON

    Example:

    JObject(JField("name", JString("joe")) :: Nil).values == Map("name" -> "joe")
    

    Definition Classes
    JFieldJValue
  46. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  47. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()
  48. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws()

Deprecated Value Members

  1. def productElements: Iterator[Any]

    Definition Classes
    Product
    Annotations
    @deprecated
    Deprecated

    (Since version 2.8.0) use productIterator instead

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from JValue

Inherited from Diffable

Inherited from AnyRef

Inherited from Any