|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.starhope.appius.util.JSONUtil
public class JSONUtil
This class contains static helper functions for converting various types of data to/from JSON form.
| Constructor Summary | |
|---|---|
JSONUtil()
|
|
| Method Summary | |
|---|---|
static javax.servlet.http.Cookie |
toCookie(org.json.JSONObject object)
|
static Date |
toDate(org.json.JSONObject o)
This is an utility method to convert a JSON object which we have created from an SQL Date value back into an SQL Date value. |
static com.google.gwt.json.client.JSONObject |
toGoogle(org.json.JSONObject in)
|
static org.json.JSONObject |
toJSON(javax.servlet.http.Cookie c)
|
static org.json.JSONObject |
toJSON(Date when)
This is an utility method to convert a Time value (java.sql.Time) into a JSONObject. |
static org.json.JSONObject |
toJSON(Set<String> data)
Convert a set of strings into a JSONArray |
static org.json.JSONObject |
toJSON(String[] strings)
This is an utility method to convert an array of Strings into a JSONObject, as a compatibility layer for Smartfox. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONUtil()
| Method Detail |
|---|
public static javax.servlet.http.Cookie toCookie(org.json.JSONObject object)
object - A JSON representation of a Cookie
public static Date toDate(org.json.JSONObject o)
throws org.json.JSONException
o - The JSON Object
org.json.JSONException - if the JSON data is badly-formedpublic static com.google.gwt.json.client.JSONObject toGoogle(org.json.JSONObject in)
in - the JSON object in JSON.Org form
public static org.json.JSONObject toJSON(javax.servlet.http.Cookie c)
throws org.json.JSONException
c - A Cookie object to be converted to JSON
org.json.JSONException - if the data can't be stored successfully
public static org.json.JSONObject toJSON(Date when)
throws org.json.JSONException
when - The Time to be converted
org.json.JSONException - If the data cannot be represented in JSON
for some reason
public static org.json.JSONObject toJSON(Set<String> data)
throws org.json.JSONException
data - The string set to be converted
org.json.JSONException - if the data cannot be represented in JSON
public static org.json.JSONObject toJSON(String[] strings)
throws org.json.JSONException
strings - An array of Strings
org.json.JSONException - if the data can't be represented in JSON
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||