Polishing
This commit is contained in:
@@ -66,7 +66,7 @@ import org.springframework.util.StringUtils;
|
||||
* <p>Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
|
||||
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
|
||||
*
|
||||
* <p>Tested against Jackson 2.2, 2.3 and 2.4; compatible with Jackson 2.0 and higher.
|
||||
* <p>Tested against Jackson 2.2, 2.3, 2.4 and 2.5; compatible with Jackson 2.0 and higher.
|
||||
*
|
||||
* @author Sebastien Deleuze
|
||||
* @author Juergen Hoeller
|
||||
@@ -451,6 +451,7 @@ public class Jackson2ObjectMapperBuilder {
|
||||
* @see #modulesToInstall(Module...)
|
||||
* @see com.fasterxml.jackson.databind.Module
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public Jackson2ObjectMapperBuilder modulesToInstall(Class<? extends Module>... modules) {
|
||||
this.moduleClasses = modules;
|
||||
this.findWellKnownModules = true;
|
||||
@@ -500,6 +501,7 @@ public class Jackson2ObjectMapperBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build a new {@link ObjectMapper} instance.
|
||||
* <p>Each build operation produces an independent {@link ObjectMapper} instance.
|
||||
@@ -682,7 +684,6 @@ public class Jackson2ObjectMapperBuilder {
|
||||
* Obtain a {@link Jackson2ObjectMapperBuilder} instance in order to
|
||||
* build an {@link XmlMapper} instance.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public static Jackson2ObjectMapperBuilder xml() {
|
||||
return new Jackson2ObjectMapperBuilder().createXmlMapper(true);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -118,7 +118,7 @@ import org.springframework.context.ApplicationContextAware;
|
||||
* Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically
|
||||
* when available (and when Java 8 and Joda-Time themselves are available, respectively).
|
||||
*
|
||||
* <p>Tested against Jackson 2.2, 2.3 and 2.4; compatible with Jackson 2.0 and higher.
|
||||
* <p>Tested against Jackson 2.2, 2.3, 2.4 and 2.5; compatible with Jackson 2.0 and higher.
|
||||
*
|
||||
* @author <a href="mailto:dmitry.katsubo@gmail.com">Dmitry Katsubo</a>
|
||||
* @author Rossen Stoyanchev
|
||||
@@ -346,6 +346,7 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
* @since 4.0.1
|
||||
* @see com.fasterxml.jackson.databind.Module
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
public void setModulesToInstall(Class<? extends Module>... modules) {
|
||||
this.builder.modulesToInstall(modules);
|
||||
}
|
||||
@@ -363,6 +364,11 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
this.builder.findModulesViaServiceLoader(findModules);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.builder.moduleClassLoader(beanClassLoader);
|
||||
}
|
||||
|
||||
/**
|
||||
* Customize the construction of Jackson handlers ({@link JsonSerializer}, {@link JsonDeserializer},
|
||||
* {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
|
||||
@@ -373,23 +379,6 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
this.builder.handlerInstantiator(handlerInstantiator);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBeanClassLoader(ClassLoader beanClassLoader) {
|
||||
this.builder.moduleClassLoader(beanClassLoader);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public void afterPropertiesSet() {
|
||||
if (this.objectMapper != null) {
|
||||
this.builder.configure(this.objectMapper);
|
||||
}
|
||||
else {
|
||||
this.objectMapper = this.builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the builder {@link ApplicationContext} in order to autowire Jackson handlers ({@link JsonSerializer},
|
||||
* {@link JsonDeserializer}, {@link KeyDeserializer}, {@code TypeResolverBuilder} and {@code TypeIdResolver}).
|
||||
@@ -402,6 +391,17 @@ public class Jackson2ObjectMapperFactoryBean implements FactoryBean<ObjectMapper
|
||||
this.builder.applicationContext(applicationContext);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() {
|
||||
if (this.objectMapper != null) {
|
||||
this.builder.configure(this.objectMapper);
|
||||
}
|
||||
else {
|
||||
this.objectMapper = this.builder.build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the singleton ObjectMapper.
|
||||
*/
|
||||
|
||||
@@ -50,7 +50,7 @@ import org.springframework.web.socket.server.HandshakeFailureException;
|
||||
import org.springframework.web.socket.server.RequestUpgradeStrategy;
|
||||
|
||||
/**
|
||||
* A {@link RequestUpgradeStrategy} for use with Jetty 9.x. Based on Jetty's
|
||||
* A {@link RequestUpgradeStrategy} for use with Jetty 9.0-9.2. Based on Jetty's
|
||||
* internal {@code org.eclipse.jetty.websocket.server.WebSocketHandler} class.
|
||||
*
|
||||
* @author Phillip Webb
|
||||
|
||||
@@ -54,7 +54,7 @@ import org.springframework.web.socket.server.RequestUpgradeStrategy;
|
||||
* <p>If the negotiation succeeds, the actual upgrade is delegated to a server-specific
|
||||
* {@link org.springframework.web.socket.server.RequestUpgradeStrategy}, which will update
|
||||
* the response as necessary and initialize the WebSocket. Currently supported servers are
|
||||
* Jetty 9.x, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
|
||||
* Jetty 9.0-9.2, Tomcat 7.0.47+ and 8.x, Undertow 1.0-1.2, GlassFish 4.1+, WebLogic 12.1.3+.
|
||||
*
|
||||
* @author Rossen Stoyanchev
|
||||
* @author Juergen Hoeller
|
||||
|
||||
Reference in New Issue
Block a user