|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.extensions.webscripts.json.JSONUtils
public class JSONUtils
Collection of JSON Utility methods. This class is immutable.
| Constructor Summary | |
|---|---|
JSONUtils()
|
|
| Method Summary | |
|---|---|
Object |
encodeJSONString(Object value)
Encodes a JSON string value |
String |
toJSONString(Object object)
Converts a given JavaScript native object and converts it to the relevant JSON string. |
org.mozilla.javascript.NativeObject |
toObject(org.json.JSONObject jsonObject)
Takes a JSON object and converts it to a native JS object. |
org.mozilla.javascript.NativeObject |
toObject(String jsonString)
Takes a JSON string and converts it to a native java script object |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JSONUtils()
| Method Detail |
|---|
public String toJSONString(Object object)
throws org.json.JSONException
object - JavaScript object
org.json.JSONException
public org.mozilla.javascript.NativeObject toObject(String jsonString)
throws org.json.JSONException
jsonString - a valid json string
org.json.JSONException
public org.mozilla.javascript.NativeObject toObject(org.json.JSONObject jsonObject)
throws org.json.JSONException
jsonObject - the json object
org.json.JSONExceptionpublic Object encodeJSONString(Object value)
value - value to encode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||