|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.json.JSONValue
public class JSONValue
Utilities to encode and decode data in JSON format.
To decode, use parse(String)
.
To encode, use toJSONString(java.lang.Object)
.
Constructor Summary | |
---|---|
JSONValue()
|
Method Summary | |
---|---|
static java.lang.Object |
parse(java.io.Reader in)
Parse (a.k.a., decode) JSON text into java object from the input source. |
static java.lang.Object |
parse(java.lang.String s)
Parse (a.k.a., decode) JSON text into java object from the string. |
static java.lang.String |
toJSONString(boolean value)
Converts a boolean to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(byte value)
Converts a byte to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(char value)
Converts a char to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(double value)
Converts a double to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(float value)
Converts a float to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(int value)
Converts an integer to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(long value)
Converts a long to JSON text patched by tomyeh |
static java.lang.String |
toJSONString(java.lang.Object value)
Convert (a.k.a., encode) an object to JSON text. |
static java.lang.String |
toJSONString(short value)
Converts a short to JSON text patched by tomyeh |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSONValue()
Method Detail |
---|
public static java.lang.Object parse(java.io.Reader in) throws java.io.IOException
in
- the input to parse.
JSONObject
(also java.util.Map),
JSONArray
(also java.util.List),
java.lang.String,
java.lang.Number,
java.lang.Boolean,
null.
If in is null, null is returned.
java.io.IOException
public static java.lang.Object parse(java.lang.String s)
public static java.lang.String toJSONString(java.lang.Object value)
If this object is a Map or a List, and it's also a JSONAware, JSONAware will be considered firstly.
DO NOT call this method from toJSONString() of a class that implements both JSONAware and Map or List with "this" as the parameter, use JSONObject.toJSONString(Map) or JSONArray.toJSONString(List) instead.
value
-
public static java.lang.String toJSONString(int value)
patched by tomyeh
public static java.lang.String toJSONString(long value)
patched by tomyeh
public static java.lang.String toJSONString(short value)
patched by tomyeh
public static java.lang.String toJSONString(double value)
patched by tomyeh
public static java.lang.String toJSONString(float value)
patched by tomyeh
public static java.lang.String toJSONString(byte value)
patched by tomyeh
public static java.lang.String toJSONString(boolean value)
patched by tomyeh
public static java.lang.String toJSONString(char value)
patched by tomyeh
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |