public final class Json
extends java.lang.Object
Constructor and Description |
---|
Json() |
Modifier and Type | Method and Description |
---|---|
static JsonObjectOrArray |
parse(Reader reader)
Parse the specified JSON text, returning a JsonObject or JsonArray, depending on what the outermost container
type is in the JSON.
|
static JsonArray |
parseArray(Reader reader)
Parse the specified JSON text, returning a JsonArray.
|
static JsonObject |
parseObject(Reader reader)
Parse the specified JSON text, returning a JsonObject.
|
static java.lang.Object |
read(Reader reader)
Return a JsonObjectReader or a JsonArrayReader for the specified JSON text, depending on what the outermost
container type is in the JSON.
|
static JsonArrayReader |
readArray(Reader reader)
Assuming the JSON text is an array, return a JsonArrayReader, to iteratively parse through the items in the array
one by one, to process each as it's parsed.
|
static JsonObjectReader |
readObject(Reader reader)
Assuming the JSON text is an object, return a JsonObjectReader, to iteratively read through the name/value pairs
in the object one by one, to process each as it's parsed.
|
static long |
toLong(java.lang.Object value) |
static JsonArrayWriter |
writeArray(Writer writer)
Serialize a JSON array, item by item.
|
static JsonObjectWriter |
writeObject(Writer writer)
Serialize a JSON array, item by item.
|
public static JsonObjectOrArray parse(Reader reader)
reader
- JSON textpublic static JsonObject parseObject(Reader reader)
reader
- JSON textpublic static JsonArray parseArray(Reader reader)
reader
- JSON textpublic static java.lang.Object read(Reader reader)
reader
- JSON textpublic static JsonObjectReader readObject(Reader reader)
reader
- JSON text, which should be a JSON arraypublic static JsonArrayReader readArray(Reader reader)
reader
- JSON text, which should be a JSON arraypublic static JsonObjectWriter writeObject(Writer writer)
public static JsonArrayWriter writeArray(Writer writer)
public static long toLong(java.lang.Object value)