public class Jackson2JsonObjectMapper extends AbstractJacksonJsonObjectMapper<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.JavaType>
toJson and fromJson
to the ObjectMapper
It customizes Jackson's default properties with the following ones:
MapperFeature.DEFAULT_VIEW_INCLUSION is disabledDeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES is disabledorg.springframework.http.converter.json.Jackson2ObjectMapperBuilder
in the spring-web for more information.supportedJsonTypes| Constructor and Description |
|---|
Jackson2JsonObjectMapper() |
Jackson2JsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper) |
| Modifier and Type | Method and Description |
|---|---|
protected com.fasterxml.jackson.databind.JavaType |
constructType(Type type) |
protected com.fasterxml.jackson.databind.JavaType |
extractJavaType(Map<String,Object> javaTypes) |
<T> T |
fromJson(com.fasterxml.jackson.core.JsonParser parser,
Type valueType) |
protected <T> T |
fromJson(Object json,
com.fasterxml.jackson.databind.JavaType type) |
com.fasterxml.jackson.databind.ObjectMapper |
getObjectMapper() |
String |
toJson(Object value) |
void |
toJson(Object value,
Writer writer) |
com.fasterxml.jackson.databind.JsonNode |
toJsonNode(Object json) |
createJavaType, fromJson, fromJson, fromJson, getClassLoader, setBeanClassLoaderclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuildResolvableType, populateJavaTypespublic Jackson2JsonObjectMapper()
public Jackson2JsonObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()
public String toJson(Object value) throws com.fasterxml.jackson.core.JsonProcessingException
com.fasterxml.jackson.core.JsonProcessingExceptionpublic void toJson(Object value, Writer writer) throws IOException
IOExceptionpublic com.fasterxml.jackson.databind.JsonNode toJsonNode(Object json) throws IOException
IOExceptionprotected <T> T fromJson(Object json, com.fasterxml.jackson.databind.JavaType type) throws IOException
fromJson in class AbstractJacksonJsonObjectMapper<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.JavaType>IOExceptionpublic <T> T fromJson(com.fasterxml.jackson.core.JsonParser parser,
Type valueType)
throws IOException
IOExceptionprotected com.fasterxml.jackson.databind.JavaType extractJavaType(Map<String,Object> javaTypes)
extractJavaType in class AbstractJacksonJsonObjectMapper<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.JavaType>protected com.fasterxml.jackson.databind.JavaType constructType(Type type)
constructType in class AbstractJacksonJsonObjectMapper<com.fasterxml.jackson.databind.JsonNode,com.fasterxml.jackson.core.JsonParser,com.fasterxml.jackson.databind.JavaType>