Packages

sealed abstract class Json extends AnyRef

This AST of JSON is made available so that arbitrary JSON may be included as part of a business object, it is not used as an intermediate representation, unlike most other JSON libraries. It is not advised to .map or .mapOrFail from these decoders, since a higher performance decoder is often available.

Beware of the potential for DOS attacks, since an attacker can provide much more data than is perhaps needed.

Also beware of converting Num (a BigDecimal) into any other kind of number, since many of the stdlib functions are non-total or are known DOS vectors (e.g. calling .toBigInteger on a "1e214748364" will consume an excessive amount of heap memory). JsonValue / Json / JValue

Self Type
Json
Linear Supertypes
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Json
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

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 arrayOrObject[X](or: => X, jsonArray: (Chunk[Json]) => X, jsonObject: (Obj) => X): X
  5. final def as[A](implicit decoder: JsonDecoder[A]): Either[String, A]
  6. def asArray: Option[Chunk[Json]]
  7. def asBoolean: Option[Boolean]
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. def asNull: Option[Unit]
  10. def asNumber: Option[Num]
  11. def asObject: Option[Obj]
  12. def asString: Option[String]
  13. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  14. final def delete(cursor: JsonCursor[_, _]): Either[String, Json]

    Deletes json node specified by given cursor

    Deletes json node specified by given cursor

    cursor

    Cursor which specifies node to delete

    returns

    Json without specified node if node specified by cursor exists, error otherwise

  15. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  16. final def equals(that: Any): Boolean
    Definition Classes
    Json → AnyRef → Any
  17. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  18. final def foldDown[A](initial: A)(f: (A, Json) => A): A
  19. final def foldDownSome[A](initial: A)(pf: PartialFunction[(A, Json), A]): A
  20. final def foldUp[A](initial: A)(f: (A, Json) => A): A
  21. final def foldUpSome[A](initial: A)(pf: PartialFunction[(A, Json), A]): A
  22. final def get[A <: Json](cursor: JsonCursor[_, A]): Either[String, A]
  23. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. final def hashCode(): Int
    Definition Classes
    Json → AnyRef → Any
  25. final def intersect(that: Json): Either[String, Json]

    Intersects JSON values.

    Intersects JSON values. If both values are Obj or Arr method returns intersections of its fields/elements, otherwise it returns error

    returns

    Intersected json if type are compatible, error otherwise

  26. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  27. def mapArray(f: (Chunk[Json]) => Chunk[Json]): Json
  28. def mapArrayValues(f: (Json) => Json): Json
  29. def mapBoolean(f: (Boolean) => Boolean): Json
  30. def mapNumber(f: (BigDecimal) => BigDecimal): Json
  31. def mapObject(f: (Obj) => Obj): Json
  32. def mapObjectEntries(f: ((String, Json)) => (String, Json)): Json
  33. def mapObjectKeys(f: (String) => String): Json
  34. def mapObjectValues(f: (Json) => Json): Json
  35. def mapString(f: (String) => String): Json
  36. final def merge(that: Json): Json

    - merging objects results in a new objects with all pairs of both sides, with the right hand side being used on key conflicts

    - merging objects results in a new objects with all pairs of both sides, with the right hand side being used on key conflicts

    - merging arrays results in all of the individual elements being merged

    - scalar values will be replaced by the right hand side

  37. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  38. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  39. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def relocate(from: JsonCursor[_, _], to: JsonCursor[_, _]): Either[String, Json]

    Relocates Json node from location specified by from cursor to location specified by to cursor.

    Relocates Json node from location specified by from cursor to location specified by to cursor.

    from

    Cursor which specifies node to relocate

    to

    Cursor which specifies location where to relocate node

    returns

    Json with relocated node if node specified by cursors exist, error otherwise

  41. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  42. def toString(): String
    Definition Classes
    Json → AnyRef → Any
  43. final def transformAt[A <: Json](cursor: JsonCursor[_, A])(f: (A) => Json): Either[String, Json]

    Transforms json node specified by given cursor

    Transforms json node specified by given cursor

    A

    refined node type

    cursor

    Cursor which specifies node to transform

    f

    Function used to transform node

    returns

    Json with transformed node if node specified by cursor exists, error otherwise

  44. final def transformDown(f: (Json) => Json): Json
  45. final def transformDownSome(pf: PartialFunction[Json, Json]): Json
  46. final def transformUp(f: (Json) => Json): Json
  47. final def transformUpSome(pf: PartialFunction[Json, Json]): Json
  48. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  49. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  50. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  51. final def widen: Json

Inherited from AnyRef

Inherited from Any

Ungrouped