public class JSON
Restrictions:
Use JSON.parse()
to obtain a JSON object from a string or file.
See JSON.Value
to know how to access to the JSON data.
Syntax:
json := object name := ( string | literal ) value := ( object | array | string | literal ) object := "{" [ name ":" value [ "," name ":" value ]* ] "}" array := "[" [ value [ "," value ]* ] "]" string := QUOTE [ CHARACTER ]* QUOTE literal := ( LETTERS | DIGITS | "_" | "." | "+" | "-" )+
Modifier and Type | Class and Description |
---|---|
static class |
JSON.Value
JSON.parse(String) returns JSON.Value . |
Constructor and Description |
---|
JSON() |
Modifier and Type | Method and Description |
---|---|
static String |
dump(JSON.Value root)
Stringify the JSON object.
|
static JSON.Value |
extend(JSON.Value root)
Handle the "extends" keyword for JSON objects at level/depth = 1
(not recursive).
|
static Boolean |
isJSONLetter(cassia.util.JSON.Reader p) |
static Boolean |
isJSONQuote(cassia.util.JSON.Reader p) |
static void |
main(Rail<String> args) |
static JSON.Value |
parse(x10.io.File file)
Declaration: parse(file:x10.io.File):cassia.util.JSON.Value{self!=null}.
Parse the file and compose a JSON object.
|
static JSON.Value |
parse(String text)
Declaration: parse(text:String):cassia.util.JSON.Value{self!=null}.
Parse the string and compose a JSON object.
|
static List<JSON.Value> |
parseArray(cassia.util.JSON.Reader p) |
static String |
parseLiteral(cassia.util.JSON.Reader p) |
static String |
parseName(cassia.util.JSON.Reader p) |
static Map<String,JSON.Value> |
parseObject(cassia.util.JSON.Reader p) |
static String |
parseString(cassia.util.JSON.Reader p) |
static Any |
parseValue(cassia.util.JSON.Reader p) |
static void |
skipSpaces(cassia.util.JSON.Reader p) |
public static Boolean isJSONLetter(cassia.util.JSON.Reader p)
public static Boolean isJSONQuote(cassia.util.JSON.Reader p)
public static void skipSpaces(cassia.util.JSON.Reader p)
public static String parseLiteral(cassia.util.JSON.Reader p)
public static String parseString(cassia.util.JSON.Reader p)
public static Any parseValue(cassia.util.JSON.Reader p)
public static String parseName(cassia.util.JSON.Reader p)
public static Map<String,JSON.Value> parseObject(cassia.util.JSON.Reader p)
public static List<JSON.Value> parseArray(cassia.util.JSON.Reader p)
public static JSON.Value parse(String text)
public static JSON.Value parse(x10.io.File file)
public static JSON.Value extend(JSON.Value root)
public static String dump(JSON.Value root)
public static void main(Rail<String> args)