p

value

package value

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. value
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Package Members

  1. package spec

Type Members

  1. final case class Index(i: Int) extends Position with Product with Serializable

    represents an index in a Json array

    represents an index in a Json array

    i

    the number of the index

  2. final case class JsArray(seq: Seq[JsValue] = Vector.empty) extends Json[JsArray] with Product with Serializable

    represents an immutable Json array.

    represents an immutable Json array. There are several ways of creating a Json array, being the most common the following:

    • From a string, array of bytes or an input stream of bytes, using the parse functions of the companion object
    • From the apply function of the companion object:
    JsArray("a",
            true,
            JsObj("a" -> 1,
                  "b" -> true,
                  "c" -> "hi"
                  ),
            JsArray(1,2)
            )
    seq

    immutable seq of JsValue

  3. final case class JsBigDec(value: BigDecimal) extends JsNumber with Product with Serializable

    Represents an immutable number of type BigDecimal

    Represents an immutable number of type BigDecimal

    value

    the value of the number

  4. final case class JsBigInt(value: BigInt) extends JsNumber with Product with Serializable

    Represents an immutable number of type BigInt

    Represents an immutable number of type BigInt

    value

    the value of the number

  5. case class JsBool(value: Boolean) extends JsValue with Product with Serializable

    represents an immutable boolean

    represents an immutable boolean

    value

    the value associated, either true or false

  6. final case class JsDouble(value: Double) extends JsNumber with Product with Serializable

    Represents an immutable number of type Double

    Represents an immutable number of type Double

    value

    the value of the number

  7. final case class JsInt(value: Int) extends JsNumber with Product with Serializable

    Represents an immutable number of type Int

    Represents an immutable number of type Int

    value

    the value of the number

  8. final case class JsLong(value: Long) extends JsNumber with Product with Serializable

    Represents an immutable number of type Long

    Represents an immutable number of type Long

    value

    the value of the number

  9. sealed trait JsNumber extends JsValue

    Represents an immutable number

  10. final case class JsObj(map: Map[String, JsValue] = HashMap.empty) extends Json[JsObj] with Product with Serializable

    represents an immutable Json object.

    represents an immutable Json object. There are several ways of creating a Json object, being the most common the following:

    • From a string, array of bytes or an input stream of bytes, using the parse functions of the companion object
    • From the apply function of the companion object:
    JsObj("a" -> 1,
          "b" -> "hi",
          "c" -> JsArray(1,2),
          "d" -> JsObj("e" -> 1,
                       "f" -> true
                      )
          )
    
    // alternative way, from a set of pairs (path,value)
    
    JsObj(
          ("a", 1),
          ("b", "hi"),
          ("c" / 0, 1),
          ("c" / 1, 2),
          ("d" / "e", 1),
          ("d" / "f", true)
         )
    map

    immutable map of JsValue

  11. case class JsObjParser(spec: JsObjSpec, additionalKeys: Boolean = false) extends Parser[JsObj] with Product with Serializable

    Represents a Json object parser.

    Represents a Json object parser. The parsed Json object must conform the specification

    spec

    specification of the Json object

    additionalKeys

    if true, the parser accepts other keys different than the specified in the spec

  12. final case class JsPath(positions: Vector[Position]) extends Product with Serializable

    Represents the full path location of an element in a json.

    Represents the full path location of an element in a json. The easiest way of creating a JsPath is:

    import value.Preamble._
    val path  = "a" / "b" / "c"
    val path1 =  0 / "a" / 1
    positions

    keys and/or indexes a path is made up of

  13. final case class JsStr(value: String) extends JsValue with Product with Serializable

    represents an immutable string

    represents an immutable string

    value

    the value of the string

  14. trait JsValue extends AnyRef

    Every element in a Json is a JsValue.

  15. trait Json[T <: Json[T]] extends JsValue
  16. case class Key(name: String) extends Position with Product with Serializable

    represents a key in a Json object

    represents a key in a Json object

    name

    name of the key

  17. sealed trait Parser[T <: Json[T]] extends AnyRef

    A parser parses an input into a Json

    A parser parses an input into a Json

    T

    the type of the Json returned

  18. sealed trait Position extends AnyRef

    represents a position in a Json.

    represents a position in a Json. A JsPath is a list of positions.

Value Members

  1. object FALSE extends JsBool
  2. object JsArray extends Serializable
  3. object JsArrayParser extends Serializable
  4. object JsNothing extends JsValue with Product with Serializable

    It's a special Json value that represents 'nothing'.

    It's a special Json value that represents 'nothing'. Inserting nothing in a json leaves the json unchanged. Functions that return a JsValue, return JsNothing when no element is found, what makes them total on their arguments.

    val obj = JsObj.empty
    obj("a") == JsNothing
    obj.inserted("a",JsNothing) == obj
  5. object JsNull extends JsValue with Product with Serializable

    Json null singleton object

  6. object JsNumber
  7. object JsObj extends Serializable
  8. object JsObjParser extends Serializable
  9. object JsPath extends Serializable
  10. object Json
  11. object MalformedJson extends Serializable
  12. object Preamble

    singleton with all the implicit conversions of the library.

    singleton with all the implicit conversions of the library. It must be always imported in order to be more concise and idiomatic defining Jsons, specs and JsPath.

  13. object TRUE extends JsBool
  14. object UserError extends Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped