Class JsonMapper
java.lang.Object
org.springframework.cloud.function.json.JsonMapper
- Direct Known Subclasses:
GsonMapper
,JacksonMapper
- Author:
- Dave Syer, Oleg Zhurakousky
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract <T> T
doFromJson
(Object json, Type type) <T> T
static boolean
isJsonString
(Object value) Performs a simple validation on an object to see if it appears to be a JSON string.static boolean
static boolean
isJsonStringRepresentsMap
(Object value) byte[]
abstract String
-
Constructor Details
-
JsonMapper
public JsonMapper()
-
-
Method Details
-
fromJson
-
doFromJson
-
toJson
-
toString
-
isJsonString
Performs a simple validation on an object to see if it appears to be a JSON string. NOTE: the validation is very rudimentary and simply checks that the object is a String and begins and ends with matching pairs of "{}" or "[]" or "\"\"" and therefore may not handle some corner cases. Primarily intended for internal of the framework.- Parameters:
value
- candidate object to evaluate- Returns:
- true if and object appears to be a valid JSON string, otherwise false.
-
isJsonStringRepresentsCollection
-
isJsonStringRepresentsMap
-