public class JSONTools
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.Integer |
DATA_TYPE_BOOLEAN |
static java.lang.Integer |
DATA_TYPE_DOUBLE |
static java.lang.Integer |
DATA_TYPE_INTEGER |
static java.lang.Integer |
DATA_TYPE_LONG |
static java.lang.Integer |
DATA_TYPE_STRING |
Constructor and Description |
---|
JSONTools() |
Modifier and Type | Method and Description |
---|---|
static boolean |
containJSONArray(org.json.JSONObject jo,
java.lang.String sKey) |
static java.util.Map<java.lang.String,java.lang.Object> |
getMap(org.json.JSONObject jo,
java.lang.String key) |
static boolean |
isEmptyObject(org.json.JSONObject jo) |
static java.util.Map<java.lang.Object,java.lang.Object> |
mapObjectToObject(org.json.JSONObject jo,
java.lang.String sString1,
java.lang.String sString2,
int iJSONDataType) |
static java.lang.Object |
toJSON(java.lang.Object object) |
static java.util.List |
toList(org.json.JSONArray ja) |
static java.util.Map<java.lang.String,java.lang.Object> |
toMap(org.json.JSONObject jo) |
public static final java.lang.Integer DATA_TYPE_STRING
public static final java.lang.Integer DATA_TYPE_INTEGER
public static final java.lang.Integer DATA_TYPE_BOOLEAN
public static final java.lang.Integer DATA_TYPE_LONG
public static final java.lang.Integer DATA_TYPE_DOUBLE
public static boolean containJSONArray(org.json.JSONObject jo, java.lang.String sKey)
jo
- sKey
- public static java.lang.Object toJSON(java.lang.Object object) throws org.json.JSONException
object
- org.json.JSONException
public static boolean isEmptyObject(org.json.JSONObject jo)
jo
- public static java.util.Map<java.lang.String,java.lang.Object> getMap(org.json.JSONObject jo, java.lang.String key) throws org.json.JSONException
jo
- key
- org.json.JSONException
public static java.util.Map<java.lang.String,java.lang.Object> toMap(org.json.JSONObject jo) throws org.json.JSONException
jo
- org.json.JSONException
public static java.util.List toList(org.json.JSONArray ja) throws org.json.JSONException
ja
- org.json.JSONException
public static java.util.Map<java.lang.Object,java.lang.Object> mapObjectToObject(org.json.JSONObject jo, java.lang.String sString1, java.lang.String sString2, int iJSONDataType)
jo
- sString1
- sString2
- iJSONDataType
-