public class Json
extends java.lang.Object
Constructor and Description |
---|
Json() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
convert(java.lang.Class<T> clazz,
java.lang.Object jsonData)
Convert 'json object' to a certain type.
|
static boolean |
jsonsEqual(java.lang.Object obj1,
java.lang.Object obj2)
Jason object/array object compare
|
static void |
main(java.lang.String[] args) |
static java.util.Map<?,?> |
readJSONFile(java.lang.String file,
java.lang.String encoding)
Read a JSON data file, and convert the data into a Java Map and return it.
|
static java.util.Map<?,?> |
readJSONFileUTF8(java.lang.String file)
Read a JSON data file with UTF-8 encoding, and convert the data into a Java Map and return it.
|
public static boolean jsonsEqual(java.lang.Object obj1, java.lang.Object obj2) throws org.json.JSONException
obj1
- obj2
- org.json.JSONException
public static java.util.Map<?,?> readJSONFileUTF8(java.lang.String file)
file
- String, the absolute JSON file.public static java.util.Map<?,?> readJSONFile(java.lang.String file, java.lang.String encoding)
file
- String, the absolute JSON file.encoding
- String, the JSON file encoding.public static <T> T convert(java.lang.Class<T> clazz, java.lang.Object jsonData)
clazz
- ClassjsonData
- Object, the json data object.public static void main(java.lang.String[] args)
Copyright © SAS Institute. All Rights Reserved.