public final class JsonToFmModel extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ROOT_ARRAY |
| Constructor and Description |
|---|
JsonToFmModel() |
| Modifier and Type | Method and Description |
|---|---|
static List<Object> |
convertJSONArrayToList(JSONArray ja)
JSONArray is an ordered sequence of values -> convert to List (equivalent to Freemarker "sequence")
|
static Map<String,Object> |
convertJSONArrayToMap(String jsonString)
Convert JSON Array string to Freemarker-compatible data model
|
static Map<String,Object> |
convertJSONObjectToMap(JSONObject jo)
JSONObject is an unordered collection of name/value pairs -> convert to Map (equivalent to Freemarker "hash")
|
static Map<String,Object> |
convertJSONObjectToMap(String jsonString)
Convert JSON Object string to Freemarker-compatible data model
|
static String |
toString(Map<String,Object> map) |
public static String ROOT_ARRAY
public static Map<String,Object> convertJSONObjectToMap(String jsonString) throws JSONException
jsonString - JSON stringJSONExceptionpublic static Map<String,Object> convertJSONObjectToMap(JSONObject jo) throws JSONException
JSONExceptionpublic static Map<String,Object> convertJSONArrayToMap(String jsonString) throws JSONException
jsonString - JSON StringJSONExceptionpublic static List<Object> convertJSONArrayToList(JSONArray ja) throws JSONException
JSONExceptionCopyright © 2016. All rights reserved.