A type alias for all Json forms.
A type alias for all Json forms. Json values should be restricted by convention to only those types used to represent Json.
A type alias for Json Arrays.
A type alias for of Json Objects.
An extractor for nested Json values.
An extractor for nested Json values.
a list of values that are either strings or integers
val A = jfield("a") val B = jfield("b") val C = jfield("c") jval match { case a:A & b:B => foo(a,b) case c:C => bar(c) }
An extractor composition operator.
An extractor composition operator.
val A = jfield("a") val B = jfield("b") val C = jfield("c") jval match { case a:A & b:B => foo(a,b) case c:C => bar(c) }
A Json unparser.
A Json unparser. It produces the most compact single line string form.
a Json tree.
if false bad data types in tree will throw exceptions; if true no exceptions are thrown and error information is included in the output (default is false).
if false, fields in maps are not sorted and performance is improved.
the Json string for the tree.
A Json parser.
A Json parser.
a Json string.
the Json tree resulting from parsing the string.
A constructor for JsonArray.
A constructor for JsonArray.
a sequence of array element values.
the constructed Json Array.
A constructor for JsonObject.
A constructor for JsonObject.
a sequence of name value pairs.
the constructed Json Object.
A Json unparser.
A Json unparser. It produces a multiple line form designed for human readability.
a Json tree.
the number of characters to indent the entire output (default is 0).
the maximum number of character that should be on a line (default is 50). This is only a goal; in practice some may contain more characters.
The maximum number of array elements that should be placed on a single line (default is 6).
if false bad data types in tree will throw exceptions; if true no exceptions are thrown and error information is included in the output (default is false).
An empty JsonArray.
An empty JsonObject.
Delete a value within a nested Json value.
Delete a value within a nested Json value.
the input Json value.
a list of values that are either strings or integers
a copy of the input with the value replaced.
Get a value within a nested Json value.
Get a value within a nested Json value.
the input Json value.
a list of values that are either strings or integers
the selected value or null if not present.
Get a JsonArray value within a nested Json value.
Get a JsonArray value within a nested Json value.
a list of values that are either strings or integers
the selected JsonArray value or an empty JsonArray if not present.
Get a big decimal value within a nested Json value.
Get a big decimal value within a nested Json value.
a list of values that are either strings or integers
the selected big decimal value or 0.0 if not present.
Get a boolean value within a nested Json value.
Get a boolean value within a nested Json value.
a list of values that are either strings or integers
the selected boolean value or false if not present.
Get a double value within a nested Json value.
Get a double value within a nested Json value.
a list of values that are either strings or integers
the selected double value or 0.0 if not present.
Get an integer value within a nested Json value.
Get an integer value within a nested Json value.
a list of values that are either strings or integers
the selected integer value or 0 if not present.
Get a long value within a nested Json value.
Get a long value within a nested Json value.
a list of values that are either strings or integers
the selected long value or 0 if not present.
Get a JsonObject value within a nested Json value.
Get a JsonObject value within a nested Json value.
a list of values that are either strings or integers
the selected JsonObject value or an empty JsonObject if not present.
Get a string value within a nested Json value.
Get a string value within a nested Json value.
a list of values that are either strings or integers
the selected string value or "" if not present.
Tests if a nested Json value is present.
Tests if a nested Json value is present.
the input Json value.
a list of values that are either strings or integers
true if the selected field is present.
Insert a value within a nested Json value.
Insert a value within a nested Json value.
the input Json value.
a list of values that are either strings or integers
the new value
a copy of the input with the value inserted. For JsonArrays the value is inserted before the specified value.
The Json null value.
Replace a value within a nested Json value.
Replace a value within a nested Json value.
the input Json value.
a list of values that are either strings or integers
the new value.
a copy of the input with the value replaced.
Get the size of a Json value.
Get the size of a Json value. - For a Json Object the number of name-value pairs. - For a Json Array the number of elements. - For anything else, 0.
Provides types and functions for working with Json types.
Json is represented by immutable Scala types. Instead of having separate Json types, type aliases are defined for Json forms.
Scala types used for Json are
- Json Object. Immutable Map[String,Json]. Note that keys are not ordered. When converting to a string with Compact or Pretty keys are sorted. - Json Array. Immutable Seq[Json] - Json String. String - Json Boolean. Boolean - Json Number. Int, Long, BigDecimal (with .), Double (with e) - Json Null. Null
Any of the Json types can be at the top level of a document (not just array and object).
The Json parser supports some extensions that are useful for human edited Json input (such as configurations).
- Comments. The characters // to end of line are discarded during parsing. - Scala-like raw strings. Start with ""{ and end with }"". Treated as normal strings after parsing. - No quotes on simple names. If an object component name starts with a letter and contains only letters and digits the " quotes are not required. After parsing names with and without quotes are not distinguished.