public class JSONUtilities
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
JSONUtilities.encoding
Encodings available for parsed and generated JSON Strings
|
Modifier and Type | Field and Description |
---|---|
static boolean |
isBeta |
static int |
subversion |
static int |
version |
Constructor and Description |
---|
JSONUtilities() |
Modifier and Type | Method and Description |
---|---|
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
|
public static int version
public static int subversion
public static boolean isBeta
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, ParseException
aJSONString
- - the string to be parsed. It is assumed that aJSONString uses the
default encoding for the platform.JSONException
ParseException
public static java.lang.Object parse(java.lang.String aJSONString, JSONUtilities.encoding theEncoding) throws JSONException, ParseException
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
ParseException