|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.quickconnectfamily.json.JSONUtilities
public class JSONUtilities
This class contains several utility methods for generating and parsing JSON strings. Care has been taken to make these match the JavaScript JSON API as much as possible. Since these methods are static you may use them without worry from within any thread or in multiple threads.
Nested Class Summary | |
---|---|
static class |
JSONUtilities.encoding
Encodings available for parsed and generated JSON Strings |
Field Summary | |
---|---|
static boolean |
isBeta
|
static int |
subversion
|
static int |
version
|
Constructor Summary | |
---|---|
JSONUtilities()
|
Method Summary | |
---|---|
static java.lang.String |
getVersion()
|
static java.lang.Object |
parse(java.lang.String aJSONString)
Parses a string using the default platform encoding. |
static java.lang.Object |
parse(java.lang.String aJSONString,
JSONUtilities.encoding theEncoding)
Parses a string using the defined encoding. |
static java.lang.String |
stringify(java.io.Serializable aSerializableObject)
Converts a Serializable object into a JSON formatted string |
static java.lang.String |
stringify(java.io.Serializable aSerializableObject,
JSONUtilities.encoding theEncoding)
Converts a Serializable object into a JSON formatted string using the specified Encoding |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int version
public static int subversion
public static boolean isBeta
Constructor Detail |
---|
public JSONUtilities()
Method Detail |
---|
public static java.lang.String getVersion()
public static java.lang.String stringify(java.io.Serializable aSerializableObject) throws JSONException
aSerializableObject
- - the object to be JSONed. This can be any Serializable Object except
a raw Object or anything that inherits from java.awt.container.
JSONException
public static java.lang.String stringify(java.io.Serializable aSerializableObject, JSONUtilities.encoding theEncoding) throws JSONException
aSerializableObject
- - the object to be JSONed. This can be any Serializable Object except
a raw Object or anything that inherits from java.awt.container.theEncoding
- - the encoding to use for the desired string. It must be one
of the encodings declared in JSONUtilities.encoding.
JSONException
public static java.lang.Object parse(java.lang.String aJSONString) throws JSONException
aJSONString
- - the string to be parsed. It is assumed that aJSONString uses the
default encoding for the platform.
JSONException
public static java.lang.Object parse(java.lang.String aJSONString, JSONUtilities.encoding theEncoding) throws JSONException
aJSONString
- - the string to be parsed. For normal behavior it must be in the encoding
declared as the theEncoding parameter.theEncoding
- - the encoding of the String passed in as aJSONString. It must be one
of the encodings declared in JSONUtilities.encoding.
JSONException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |