public final class JsonUtils extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
JsonUtils.JsonToken
Types of Json tokens.
|
static class |
JsonUtils.Types |
| Modifier and Type | Method and Description |
|---|---|
static String |
getJsonString(String string)
Transform Java String to JSON string.
|
static JsonUtils.Types |
getType(Class<?> clazz)
Get corresponding
JsonUtils.Types for specified class. |
static JsonUtils.Types |
getType(Object o)
Get corresponding
JsonUtils.Types for specified Object. |
static boolean |
isKnownType(Class<?> clazz)
Check is given class object represents:
Primitive type
Primitive type wrapper
String
Array of T where T satisfies 1 or 2 or 3
|
static boolean |
isKnownType(Object o)
Check is given object has on of types:
null
Primitive type
Primitive type wrapper
String
Array of T where T satisfies 2 or 3 or 4
|
public static String getJsonString(String string)
string - source String.public static boolean isKnownType(Object o)
nullo - Objecttrue if Object has one of described above type,
false otherwisepublic static boolean isKnownType(Class<?> clazz)
clazz - class.true if class object represent one of described
above, false otherwisepublic static JsonUtils.Types getType(Object o)
JsonUtils.Types for specified Object. If object is NOT :
null will be returnedo - Object.JsonUtils.Types or null (see above)KNOWN_TYPESpublic static JsonUtils.Types getType(Class<?> clazz)
JsonUtils.Types for specified class. If class object is
NOT :
null will be returnedclazz - Object.JsonUtils.Types or null (see above)KNOWN_TYPESCopyright © 2020 eXo Platform SAS. All Rights Reserved.