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. JField
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. JValue
  7. Diffable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

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

Type Members

  1. type Values = (String, JValue.Values)

    Definition Classes
    JFieldJValue
  2. final class WithFilter extends AnyRef

    Definition Classes
    JValue

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[JValue.\.A.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[JValue.\\.A.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 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
  14. def clone(): AnyRef

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

    Return a diff.

    Return a diff.

    Definition Classes
    Diffable
    See also

    net.liftweb.json.Diff#diff

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

    Definition Classes
    AnyRef
  17. 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
  18. 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
  19. 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
  20. 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
  21. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  22. 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
  23. 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
  24. final def getClass(): Class[_]

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

    Definition Classes
    Any
  26. 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
  27. val name: String

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

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

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

    Definition Classes
    AnyRef
  31. 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
  32. 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
  33. final def synchronized[T0](arg0: ⇒ T0): T0

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

    Definition Classes
    JValue
  35. 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
  36. val value: JValue

  37. def values: (String, JValue.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
  38. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  41. def withFilter(p: (JValue) ⇒ Boolean): WithFilter

    To make 2.

    To make 2.10 happy

    Definition Classes
    JValue

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from JValue

Inherited from Diffable

Inherited from AnyRef

Inherited from Any

Ungrouped