Polishing
This commit is contained in:
@@ -128,10 +128,12 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
|
||||
private DateFormat dateFormat;
|
||||
|
||||
private JsonInclude.Include serializationInclusion;
|
||||
|
||||
private AnnotationIntrospector annotationIntrospector;
|
||||
|
||||
private PropertyNamingStrategy propertyNamingStrategy;
|
||||
|
||||
private JsonInclude.Include serializationInclusion;
|
||||
|
||||
private final Map<Class<?>, JsonSerializer<?>> serializers = new LinkedHashMap<Class<?>, JsonSerializer<?>>();
|
||||
|
||||
private final Map<Class<?>, JsonDeserializer<?>> deserializers = new LinkedHashMap<Class<?>, JsonDeserializer<?>>();
|
||||
@@ -144,8 +146,6 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
|
||||
private boolean findModulesViaServiceLoader;
|
||||
|
||||
private PropertyNamingStrategy propertyNamingStrategy;
|
||||
|
||||
private ClassLoader beanClassLoader;
|
||||
|
||||
|
||||
@@ -184,6 +184,15 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
this.annotationIntrospector = annotationIntrospector;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a {@link com.fasterxml.jackson.databind.PropertyNamingStrategy} to
|
||||
* configure the {@link ObjectMapper} with.
|
||||
* @since 4.0.2
|
||||
*/
|
||||
public void setPropertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy) {
|
||||
this.propertyNamingStrategy = propertyNamingStrategy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set a custom inclusion strategy for serialization.
|
||||
* @see com.fasterxml.jackson.annotation.JsonInclude.Include
|
||||
@@ -331,15 +340,6 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
this.findModulesViaServiceLoader = findModules;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specify a {@link com.fasterxml.jackson.databind.PropertyNamingStrategy} to
|
||||
* configure the {@link ObjectMapper} with.
|
||||
* @since 4.0.2
|
||||
*/
|
||||
public void setPropertyNamingStrategy(PropertyNamingStrategy propertyNamingStrategy) {
|
||||
this.propertyNamingStrategy = propertyNamingStrategy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.beanClassLoader = beanClassLoader;
|
||||
|
||||
@@ -249,8 +249,8 @@ public final class WebAsyncManager {
|
||||
* @see #getConcurrentResult()
|
||||
* @see #getConcurrentResultContext()
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes" })
|
||||
public void startCallableProcessing(final Callable<?> callable, Object... processingContext) throws Exception {
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
public void startCallableProcessing(Callable<?> callable, Object... processingContext) throws Exception {
|
||||
Assert.notNull(callable, "Callable must not be null");
|
||||
startCallableProcessing(new WebAsyncTask(callable), processingContext);
|
||||
}
|
||||
|
||||
@@ -23,11 +23,6 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.FatalBeanException;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.core.JsonGenerator;
|
||||
import com.fasterxml.jackson.core.JsonParser;
|
||||
@@ -50,6 +45,10 @@ import com.fasterxml.jackson.databind.ser.Serializers;
|
||||
import com.fasterxml.jackson.databind.ser.std.ClassSerializer;
|
||||
import com.fasterxml.jackson.databind.ser.std.NumberSerializers.NumberSerializer;
|
||||
import com.fasterxml.jackson.databind.type.SimpleType;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.beans.FatalBeanException;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
@@ -65,11 +64,13 @@ public class Jackson2ObjectMapperFactoryBeanTests {
|
||||
|
||||
private Jackson2ObjectMapperFactoryBean factory;
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
factory = new Jackson2ObjectMapperFactoryBean();
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void testSettersWithNullValues() {
|
||||
// Should not crash:
|
||||
|
||||
Reference in New Issue
Block a user