Packages

t

value

Json

sealed trait Json[T <: Json[T]] extends JsValue

Linear Supertypes
JsValue, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Json
  2. JsValue
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def filterAll(p: (JsPrimitive) ⇒ Boolean): T

    Selects all the values of this Json which satisfy a predicate and are not Jsons.

    Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.

    p

    the predicate uses to test elements. The predicate accepts the value of each element

    returns

    a new Json consisting of all elements of this Json that satisfy the given predicate p.

  2. abstract def filterAll(p: (JsPath, JsPrimitive) ⇒ Boolean): T

    Selects all the values of this Json which satisfy a predicate and are not Jsons.

    Selects all the values of this Json which satisfy a predicate and are not Jsons. When a Json is found, it is filtered recursively.

    p

    the predicate uses to test elements. The predicate accepts the path/value pair of each element

    returns

    a new Json consisting of all elements of this Json that satisfy the given predicate p.

  3. abstract def filterAllJsObj(p: (JsObj) ⇒ Boolean): T

    Removes all the Json object of this Json which dont' satisfy a predicate.

    Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).

    p

    the predicate uses to test the Json object.

    returns

    a new Json consisting of all its elements except those Json object that dont satisfy the given predicate p.

  4. abstract def filterAllJsObj(p: (JsPath, JsObj) ⇒ Boolean): T

    Removes all the Json object of this Json which dont' satisfy a predicate.

    Removes all the Json object of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively (if it passes the filter).

    p

    the predicate uses to test the path/object pairs.

    returns

    a new Json consisting of all its elements except those Json object that dont satisfy the given predicate p.

  5. abstract def filterAllKeys(p: (String) ⇒ Boolean): T

    Removes all the keys of this Json which dont' satisfy a predicate.

    Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.

    p

    the predicate uses to test the keys.

    returns

    a new Json consisting of all array elements of this Json and those key/value pairs that satisfy the given predicate p.

  6. abstract def filterAllKeys(p: (JsPath, JsValue) ⇒ Boolean): T

    Removes all the keys of this Json which dont' satisfy a predicate.

    Removes all the keys of this Json which dont' satisfy a predicate. When a Json is found, it is filtered recursively.

    p

    the predicate uses to test the path/value pairs.

    returns

    a new Json consisting of all array elements of this Json and those key/value pairs that satisfy the given predicate p.

  7. abstract def flatten: Stream[(JsPath, JsValue)]
  8. abstract def id: Int

    Every implementation of this trait has an unique identifier in order.

    Every implementation of this trait has an unique identifier in order.

    returns

    unique identifier of the type

    Definition Classes
    JsValue
  9. abstract def init: T

    The initial part of the Json object without its last element.

  10. abstract def insert(path: JsPath, value: JsValue, padWith: JsValue = JsNull): T

    Creates a new Json obtained by inserting a given path/value pair into this Json.

    Creates a new Json obtained by inserting a given path/value pair into this Json. The given element is always inserted at the given path, even if it requires to create new Json or padding arrays.

    path

    the path

    value

    the value

    returns

    A new Json with the new path/value mapping added to this Json.

  11. abstract def isArr: Boolean

    returns true if this is an array

    returns true if this is an array

    Definition Classes
    JsValue
  12. abstract def isEmpty: Boolean

    returns true if the Json is empty

    returns true if the Json is empty

    returns

    true if empty, false otherwise

  13. abstract def isObj: Boolean

    returns true if this is an object

    returns true if this is an object

    Definition Classes
    JsValue
  14. abstract def mapAll(m: (JsPrimitive) ⇒ JsValue): T

    Builds a new Json by applying a function to all elements of this Json that are not Json.

    Builds a new Json by applying a function to all elements of this Json that are not Json. When a Json is found, it it mapped recursively.

    m

    the function to apply to each element. It accepts the value of each element

    returns

    a new Json resulting from applying the given map function to each element of this Json that satisfies the filter and collecting the results.

  15. abstract def mapAll(m: (JsPath, JsPrimitive) ⇒ JsValue, p: (JsPath, JsPrimitive) ⇒ Boolean): T

    Builds a new Json by applying a function to all elements of this Json that are not Json and satisfies a given predicate.

    Builds a new Json by applying a function to all elements of this Json that are not Json and satisfies a given predicate. When a Json is found, it it mapped recursively.

    m

    the function to apply to each element. The predicate accepts the path/value pair of each element

    p

    filter to select which elements will be mapped. By default all the elements are selected.

    returns

    a new Json resulting from applying the given map function to each element of this Json that satisfies the filter and collecting the results.

  16. abstract def mapAllKeys(m: (String) ⇒ String): T

    Builds a new Json by applying a function to all the keys of this Json.

    Builds a new Json by applying a function to all the keys of this Json. If the element associated to a key is a Json, the function is applied recursively,

    m

    the function to apply to each key. It accepts the key name as a parameter

  17. abstract def mapAllKeys(m: (JsPath, JsValue) ⇒ String, p: (JsPath, JsValue) ⇒ Boolean): T

    Builds a new Json by applying a function to all the keys of this Json that satisfies a given predicate.

    Builds a new Json by applying a function to all the keys of this Json that satisfies a given predicate. If the element associated to a key is a Json, the function is applied recursively,

    m

    the function to apply to each key. It accepts the path/value pair as parameters

    p

    the predicate to select which keys will be mapped

  18. abstract def reduceAll[V](p: (JsPath, JsPrimitive) ⇒ Boolean, m: (JsPath, JsPrimitive) ⇒ V, r: (V, V) ⇒ V): Option[V]
  19. abstract def remove(path: JsPath): T

    Removes a path from this Json

    Removes a path from this Json

    path

    the path to be remove

    returns

    If this Json does not contain a binding for path it is returned unchanged. Otherwise, returns a new Json without a binding for path

  20. abstract def removeAll(xs: TraversableOnce[JsPath]): T

    Creates a new Json from this Json by removing all paths of another collection

    Creates a new Json from this Json by removing all paths of another collection

    xs

    the collection containing the paths to remove

    returns

    a new Json with the given paths remove.

  21. abstract def size: Int
  22. abstract def tail: T

    The rest of the Json object without its first element.

  23. abstract def toJsArray: JsArray

    returns this value as a JsArray if it's an array, throwing an UserError otherwise.

    returns this value as a JsArray if it's an array, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isArr can help to that purpose.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  24. abstract def toJsObj: JsObj

    returns this value as a JsObj if it's an object, throwing an UserError otherwise.

    returns this value as a JsObj if it's an object, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isObj can help to that purpose.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )
  25. abstract def toJson: Json[_]

    returns this value as a Json if it's an object or an array, throwing an UserError otherwise.

    returns this value as a Json if it's an object or an array, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isJson can help to that purpose.

    Definition Classes
    JsValue
    Annotations
    @throws( classOf[value.UserError] )

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def apply(path: JsPath): JsValue

    Returns the element located at a specified path.

    Returns the element located at a specified path. This function is total on its argument. If no element is found, JsNothing is returned

    path

    the path

    returns

    the json value found at the path

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  7. def containsPath(path: JsPath): Boolean

    Returns true if there is an element at the specified path

    Returns true if there is an element at the specified path

    path

    the path

    returns

    true if the path exists, false otherwise

  8. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  9. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  10. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  11. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  13. def isArr(predicate: (JsArray) ⇒ Boolean): Boolean

    returns true if this is an array that satisfies a predicate

    returns true if this is an array that satisfies a predicate

    Definition Classes
    JsValue
  14. def isBigDec: Boolean

    returns true if this is a big decimal.

    returns true if this is a big decimal.

    Definition Classes
    JsonJsValue
  15. def isBigInt: Boolean

    returns true if this is a big integer.

    returns true if this is a big integer.

    Definition Classes
    JsonJsValue
  16. def isBool: Boolean

    returns true if this is a boolean

    returns true if this is a boolean

    Definition Classes
    JsonJsValue
  17. def isDecimal(predicate: (BigDecimal) ⇒ Boolean): Boolean

    returns true if this is a big decimal that satisfies a predicate

    returns true if this is a big decimal that satisfies a predicate

    Definition Classes
    JsValue
  18. def isDecimal: Boolean

    returns true if this type is a decimal number

    returns true if this type is a decimal number

    returns

    isDouble || isBigDec

    Definition Classes
    JsValue
  19. def isDouble: Boolean

    returns true if this is a double

    returns true if this is a double

    Definition Classes
    JsonJsValue
  20. def isDouble(predicate: (Double) ⇒ Boolean): Boolean

    returns true if this is a double that satisfies a predicate

    returns true if this is a double that satisfies a predicate

    Definition Classes
    JsValue
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. def isInt: Boolean

    returns true if this is an integer (32 bit precision number)

    returns true if this is an integer (32 bit precision number)

    Definition Classes
    JsonJsValue
  23. def isInt(predicate: (Int) ⇒ Boolean): Boolean

    returns true if this is an integer that satisfies a predicate

    returns true if this is an integer that satisfies a predicate

    Definition Classes
    JsValue
  24. def isIntegral(predicate: (BigInt) ⇒ Boolean): Boolean

    returns true if this is a big integer that satisfies a predicate

    returns true if this is a big integer that satisfies a predicate

    Definition Classes
    JsValue
  25. def isIntegral: Boolean

    returns true if this type is an integral number

    returns true if this type is an integral number

    returns

    isInt || isLong || isBigInt

    Definition Classes
    JsValue
  26. def isJson: Boolean

    returns true is this type is an array or an object

    returns true is this type is an array or an object

    Definition Classes
    JsValue
  27. def isJson(predicate: (Json[_]) ⇒ Boolean): Boolean

    returns true if this is a json that satisfies a predicate

    returns true if this is a json that satisfies a predicate

    predicate

    the predicate

    Definition Classes
    JsValue
  28. def isLong: Boolean

    returns true if this is a long (62 bit precision number)

    returns true if this is a long (62 bit precision number)

    Definition Classes
    JsonJsValue
  29. def isLong(predicate: (Long) ⇒ Boolean): Boolean

    returns true if this is a long that satisfies a predicate

    returns true if this is a long that satisfies a predicate

    Definition Classes
    JsValue
  30. def isNotEmpty: Boolean
  31. def isNotJson: Boolean

    returns true if this is neither an object nor an array

    returns true if this is neither an object nor an array

    Definition Classes
    JsValue
  32. def isNotNull: Boolean

    returns true if this is not null

    returns true if this is not null

    Definition Classes
    JsValue
  33. def isNotNumber: Boolean

    returns true if this is not a number

    returns true if this is not a number

    Definition Classes
    JsValue
  34. def isNothing: Boolean

    returns true if this is JsNothing

    returns true if this is JsNothing

    Definition Classes
    JsonJsValue
  35. def isNull: Boolean

    returns true if this is JsNull

    returns true if this is JsNull

    Definition Classes
    JsonJsValue
  36. def isNumber: Boolean

    returns true if this is a number

    returns true if this is a number

    Definition Classes
    JsonJsValue
  37. def isObj(predicate: (JsObj) ⇒ Boolean): Boolean

    returns true if this is an object that satisfies a predicate

    returns true if this is an object that satisfies a predicate

    Definition Classes
    JsValue
  38. def isPrimitive: Boolean

    returns true is this is a primitive type

    returns true is this is a primitive type

    Definition Classes
    JsonJsValue
  39. def isStr: Boolean

    returns true if this is a string

    returns true if this is a string

    Definition Classes
    JsonJsValue
  40. def isStr(predicate: (String) ⇒ Boolean): Boolean

    returns true if this is a string that satisfies a predicate

    returns true if this is a string that satisfies a predicate

    Definition Classes
    JsValue
  41. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  42. def nonEmpty: Boolean

    returns true if the Json is non empty

    returns true if the Json is non empty

    returns

    true if non empty, false otherwise

  43. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  44. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  45. def serialize: Array[Byte]

    Serialize this Json into an array of bytes.

    Serialize this Json into an array of bytes. When possible, it's more efficient to work on byte level that with strings

    returns

    this Json serialized into an array of bytes

  46. def serialize(outputStream: OutputStream): () ⇒ Unit

    Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything

    Returns a zero-argument function that when called, it serializes this Json into the given output stream, no returning anything

    outputStream

    the output stream

    returns

    () => Unit function that serializes this Json into the given output stream

  47. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  48. def toJsBigDec: JsBigDec

    returns this value as a JsBigDec if it's a decimal number, throwing an UserError otherwise.

    returns this value as a JsBigDec if it's a decimal number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isDecimal can help to that purpose.

    Definition Classes
    JsonJsValue
  49. def toJsBigInt: JsBigInt

    returns this value as a JsBigInt if it's an integral number, throwing an UserError otherwise.

    returns this value as a JsBigInt if it's an integral number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isIntegral can help to that purpose.

    Definition Classes
    JsonJsValue
  50. def toJsBool: JsBool

    returns this value as a JsBool if it's a boolean, throwing an UserError otherwise.

    returns this value as a JsBool if it's a boolean, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isBool can help to that purpose.

    Definition Classes
    JsonJsValue
  51. def toJsDouble: JsDouble

    returns this value as a JsDouble if it is a JsLong or a JsInt or a JsDouble, throwing an UserError otherwise.

    returns this value as a JsDouble if it is a JsLong or a JsInt or a JsDouble, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isInt || isLong || isDouble can help to that purpose.

    Definition Classes
    JsonJsValue
  52. def toJsInt: JsInt

    returns this value as a JsInt, throwing an UserError otherwise.

    returns this value as a JsInt, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isInt can help to that purpose.

    Definition Classes
    JsonJsValue
  53. def toJsLong: JsLong

    returns this value as a JsLong if it is a JsLong or a JsInt, throwing an UserError otherwise.

    returns this value as a JsLong if it is a JsLong or a JsInt, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isInt || isLong can help to that purpose.

    Definition Classes
    JsonJsValue
  54. def toJsNull: JsNull.type

    returns this value as a JsNull if it's null, throwing an UserError otherwise.

    returns this value as a JsNull if it's null, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isNull can help to that purpose.

    Definition Classes
    JsonJsValue
  55. def toJsNumber: JsNumber

    returns this value as a JsNumber if it's a number, throwing an UserError otherwise.

    returns this value as a JsNumber if it's a number, throwing an UserError otherwise. It's the responsibility of the caller to make sure the invocation to this function doesn't fail. The guard condition isNumber can help to that purpose.

    Definition Classes
    JsonJsValue
  56. def toJsPrimitive: JsPrimitive
    Definition Classes
    JsonJsValue
  57. def toJsStr: JsStr

    returns this value as a JsStr if it's a string, throwing an UserError otherwise.

    returns this value as a JsStr if it's a string, throwing an UserError otherwise. It's the responsibility of the caller to make sure the call to this function doesn't fail. The guard condition isStr can help to that purpose.

    Definition Classes
    JsonJsValue
  58. def toPrettyString: String

    Converts the string representation of this Json to a pretty print version

    Converts the string representation of this Json to a pretty print version

    returns

    pretty print version of the string representation of this Json

  59. def toString(): String
    Definition Classes
    AnyRef → Any
  60. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from JsValue

Inherited from AnyRef

Inherited from Any

Ungrouped