public class JsonUtil extends Object
Constructor and Description |
---|
JsonUtil() |
Modifier and Type | Method and Description |
---|---|
static boolean |
isValidJson(String json)
Is valid json boolean.
|
static <T> T |
json2Object(InputStream is,
Class<T> classOfT)
Json 2 object t.
|
static <T> T |
json2Object(String json,
Class<T> classOfT)
Json 2 object t.
|
static String |
object2Json(Object obj)
Object 2 json string.
|
static StringBuffer |
sbObject2Json(Object obj)
Sb object 2 json string buffer.
|
static List<String> |
validate(String json,
String jsonSchema)
Validate list.
|
public static String object2Json(Object obj)
obj
- the objpublic static StringBuffer sbObject2Json(Object obj)
obj
- the objpublic static <T> T json2Object(String json, Class<T> classOfT)
T
- the type parameterjson
- the jsonclassOfT
- the class of tpublic static <T> T json2Object(InputStream is, Class<T> classOfT)
T
- the type parameteris
- the isclassOfT
- the class of tpublic static boolean isValidJson(String json)
json
- the jsonCopyright © 2017. All rights reserved.