public class JSONUtils extends Object
| Constructor and Description |
|---|
JSONUtils() |
| Modifier and Type | Method and Description |
|---|---|
Object |
encodeJSONString(Object value)
Encodes a JSON string value
|
org.json.simple.JSONObject |
toJSONObject(Object object)
Converts the given JavaScript native object to a org.json.simple.JSONObject Java Object.
|
String |
toJSONString(Object object)
Converts a given JavaScript native object and converts it to the relevant JSON string.
|
org.mozilla.javascript.NativeArray |
toObject(org.json.simple.JSONArray jsonArray)
Takes a JSON array and converts it to a native JS array.
|
org.mozilla.javascript.NativeObject |
toObject(org.json.simple.JSONObject jsonObject)
Takes a JSON object and converts it to a native JS object.
|
org.mozilla.javascript.ScriptableObject |
toObject(String jsonString)
Takes a JSON string and converts it to a native java script object or array
|
public String toJSONString(Object object) throws IOException
object - JavaScript objectIOExceptionpublic org.json.simple.JSONObject toJSONObject(Object object) throws IOException
object - JavaScript native objectIOExceptionpublic org.mozilla.javascript.ScriptableObject toObject(String jsonString)
jsonString - a valid json stringpublic org.mozilla.javascript.NativeObject toObject(org.json.simple.JSONObject jsonObject)
jsonObject - the json objectpublic org.mozilla.javascript.NativeArray toObject(org.json.simple.JSONArray jsonArray)
jsonArray - the json arrayCopyright © 2005–2016 Alfresco Software. All rights reserved.