|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcc.plural.jsonij.JSON
public class JSON
JSON document class. This class defines the representation of each of the JSON types and provides methods to parse and create JSON instances from various sources. All JSON types extend Value. The following table documents which class to use when representing each of the JSON types.
| JSON Type | Class |
| Object | JSON.Object |
| Array | JSON.Array |
| String | JSON.String |
| Numeric | JSON.Numeric |
| True | JSON.TRUE |
| False | JSON.FALSE |
| Null | JSON.NULL |
| Nested Class Summary | |
|---|---|
static class |
JSON.Array<E extends Value>
JSON Array. |
static class |
JSON.Boolean
JSON Boolean. |
static class |
JSON.False
JSON False Implementation. |
static class |
JSON.Null
JSON Null Implementation. |
static class |
JSON.Numeric
JSON Numeric. |
static class |
JSON.Object<K extends CharSequence,V extends Value>
JSON Object. |
static class |
JSON.String
JSON String. |
static class |
JSON.True
JSON True Implementation. |
| Field Summary | |
|---|---|
static JSON.False |
FALSE
Static Instance holding the JSON False instance. |
static JSON.Null |
NULL
Static Instance holding the JSON Null instance. |
static JSON.True |
TRUE
Static Instance holding the JSON True instance. |
| Constructor Summary | |
|---|---|
JSON(Value root)
Default JSON constructor. |
|
| Method Summary | |
|---|---|
boolean |
equals(Object o)
|
Value |
get(int i)
Value accessor by index for the root JSON Value. |
Value |
get(String key)
Value accessor by String for the root JSON Value. |
boolean |
getBoolean()
Boolean accessor for the root JSON Value. |
double |
getDouble()
Double accessor for the root JSON Value. |
int |
getInt()
Integer accessor for the root JSON Value. |
Value |
getRoot()
Accessor for the root value for this JSON Document. |
String |
getString()
String accessor for the root JSON Value. |
int |
hashCode()
|
boolean |
isNull()
Null check for the root JSON Value. |
static JSON |
parse(Reader documentReader)
Parse Method that parses from a Reader. |
static JSON |
parse(String document)
Parse Method that parses from a String. |
int |
size()
Size inspector for the root JSON Value. |
String |
toJSON()
Converts JSON Document into a valid JSON String. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final JSON.True TRUE
public static final JSON.False FALSE
public static final JSON.Null NULL
| Constructor Detail |
|---|
public JSON(Value root)
root - | Method Detail |
|---|
public Value getRoot()
public int size()
openecho.json.Value#size()public boolean isNull()
openecho.json.Value#isNull()public boolean getBoolean()
openecho.json.Value#getBoolean()public int getInt()
openecho.json.Value#getInt()public double getDouble()
openecho.json.Value#getDouble()public String getString()
openecho.json.Value#getString()public Value get(int i)
i - The index to access.
openecho.json.Value#get(int i)public Value get(String key)
key - The key to access.
openecho.json.Value#get(java.lang.String key)public String toJSON()
public String toString()
toString in class Objectpublic boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Object
public static JSON parse(String document)
throws ParserException,
IOException
document - The document.
ParserException - JSON Parser Exception.
IOException - IO Exception.
public static JSON parse(Reader documentReader)
throws ParserException,
IOException
documentReader - The Reader parameter.
ParserException - JSON Parser Exception.
IOException - IO Exception.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||