@Provider @Component(value="blObjectMapperProvider") @Scope(value="singleton") public class ObjectMapperProvider extends Object implements javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>, org.springframework.beans.factory.InitializingBean
Customized provider for a Jackson ObjectMapper that ensures single-element objects are serialized in JSON array syntax both on Serialization and Deserialization.
This also ensures that the JaxbAnnotationModule is registered with the ObjectMapper.
| Modifier and Type | Field and Description |
|---|---|
protected com.fasterxml.jackson.databind.ObjectMapper |
mapper |
protected WrapperOverrideTypeModifier |
typeModifier |
| Constructor and Description |
|---|
ObjectMapperProvider() |
protected WrapperOverrideTypeModifier typeModifier
protected com.fasterxml.jackson.databind.ObjectMapper mapper
public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic com.fasterxml.jackson.databind.ObjectMapper getContext(Class<?> type)
getContext in interface javax.ws.rs.ext.ContextResolver<com.fasterxml.jackson.databind.ObjectMapper>Copyright © 2015. All Rights Reserved.