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.SUPPORTED_JSON_TYPES
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, setBeanClassLoader
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
populateJavaTypes
public 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.JsonProcessingException
public void toJson(Object value, Writer writer) throws IOException
IOException
public com.fasterxml.jackson.databind.JsonNode toJsonNode(Object json) throws IOException
IOException
protected <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>
IOException
public <T> T fromJson(com.fasterxml.jackson.core.JsonParser parser, Type valueType) throws IOException
IOException
protected 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>