Class JsonUtils
java.lang.Object
org.exoplatform.ws.frameworks.json.impl.JsonUtils
- Version:
- $Id: JsonUtils.java 34417 2009-07-23 14:42:56Z dkatayev $
- Author:
- Andrey Parfonov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTypes of Json tokens.static enum -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetJsonString(String string) Transform Java String to JSON string.static JsonUtils.TypesGet correspondingJsonUtils.Typesfor specified class.static JsonUtils.TypesGet correspondingJsonUtils.Typesfor specified Object.static booleanisKnownType(Class<?> clazz) Check is given class object represents: Primitive type Primitive type wrapper String Array of T where T satisfies 1 or 2 or 3static booleanCheck is given object has on of types:nullPrimitive type Primitive type wrapper String Array of T where T satisfies 2 or 3 or 4
-
Method Details
-
getJsonString
Transform Java String to JSON string.- Parameters:
string- source String.- Returns:
- result.
-
isKnownType
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
- Parameters:
o- Object- Returns:
trueif Object has one of described above type,falseotherwise
-
isKnownType
Check is given class object represents:- Primitive type
- Primitive type wrapper
- String
- Array of T where T satisfies 1 or 2 or 3
- Parameters:
clazz- class.- Returns:
trueif class object represent one of described above,falseotherwise
-
getType
Get correspondingJsonUtils.Typesfor specified Object. If object is NOT :- Known type (primitive, String, array of primitive or String)
- Array
- Collection<?>
- Map<String, ?>
nullwill be returned- Parameters:
o- Object.- Returns:
JsonUtils.Typesornull(see above)- See Also:
-
getType
Get correspondingJsonUtils.Typesfor specified class. If class object is NOT :- Known type (primitive, String, array of primitive or String)
- Array
- Collection
- Map
nullwill be returned- Parameters:
clazz- Object.- Returns:
JsonUtils.Typesornull(see above)- See Also:
-