Class AbstractJacksonJsonObjectMapper<N,P,J>
java.lang.Object
org.springframework.integration.support.json.AbstractJacksonJsonObjectMapper<N,P,J>
- Type Parameters:
N
- - The expected type of JSON Node.P
- - The expected type of JSON Parser.J
- - The expected type of Java Type representation.
- All Implemented Interfaces:
Aware
,BeanClassLoaderAware
,JsonObjectMapper<N,P>
- Direct Known Subclasses:
Jackson2JsonObjectMapper
public abstract class AbstractJacksonJsonObjectMapper<N,P,J> extends Object implements JsonObjectMapper<N,P>, BeanClassLoaderAware
Base class for Jackson
JsonObjectMapper
implementations.- Since:
- 3.0
- Author:
- Artem Bilan
-
Field Summary
Fields Modifier and Type Field Description protected static Collection<Class<?>>
SUPPORTED_JSON_TYPES
-
Constructor Summary
Constructors Constructor Description AbstractJacksonJsonObjectMapper()
-
Method Summary
Modifier and Type Method Description protected abstract J
constructType(Type type)
protected J
createJavaType(Map<String,Object> javaTypes, String javaTypeKey)
protected abstract J
extractJavaType(Map<String,Object> javaTypes)
protected abstract <T> T
fromJson(Object json, J type)
<T> T
fromJson(Object json, Class<T> valueType)
<T> T
fromJson(Object json, Map<String,Object> javaTypes)
<T> T
fromJson(Object json, ResolvableType valueType)
Deserialize a JSON to an expectedResolvableType
.protected ClassLoader
getClassLoader()
void
setBeanClassLoader(ClassLoader classLoader)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.integration.support.json.JsonObjectMapper
fromJson, populateJavaTypes, toJson, toJson, toJsonNode
-
Field Details
-
Constructor Details
-
AbstractJacksonJsonObjectMapper
public AbstractJacksonJsonObjectMapper()
-
-
Method Details
-
setBeanClassLoader
- Specified by:
setBeanClassLoader
in interfaceBeanClassLoaderAware
-
getClassLoader
-
fromJson
- Specified by:
fromJson
in interfaceJsonObjectMapper<N,P>
- Throws:
IOException
-
fromJson
Description copied from interface:JsonObjectMapper
Deserialize a JSON to an expectedResolvableType
.- Specified by:
fromJson
in interfaceJsonObjectMapper<N,P>
- Type Parameters:
T
- the expected object type- Parameters:
json
- the JSON to deserializevalueType
- theResolvableType
for the target object.- Returns:
- deserialization result object
- Throws:
IOException
- a JSON parsing exception
-
fromJson
- Specified by:
fromJson
in interfaceJsonObjectMapper<N,P>
- Throws:
IOException
-
createJavaType
-
fromJson
- Throws:
IOException
-
extractJavaType
-
constructType
-