Extract AbstractCodecConfigurer base class

Issue: SPR-15247
This commit is contained in:
Rossen Stoyanchev
2017-03-27 12:07:18 -04:00
parent 5211a099d5
commit dc3851df00
5 changed files with 722 additions and 474 deletions

View File

@@ -71,16 +71,6 @@ import org.springframework.web.server.handler.ResponseStatusExceptionHandler;
*/
public class WebFluxConfigurationSupport implements ApplicationContextAware {
private static final boolean jackson2Present =
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper",
WebFluxConfigurationSupport.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator",
WebFluxConfigurationSupport.class.getClassLoader());
private static final boolean jaxb2Present =
ClassUtils.isPresent("javax.xml.bind.Binder", WebFluxConfigurationSupport.class.getClassLoader());
private Map<String, CorsConfiguration> corsConfigurations;
private PathMatchConfigurer pathMatchConfigurer;
@@ -159,7 +149,7 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware {
*/
protected Map<String, MediaType> getDefaultMediaTypeMappings() {
Map<String, MediaType> map = new HashMap<>();
if (jackson2Present) {
if (ServerCodecConfigurer.jackson2Present) {
map.put("json", MediaType.APPLICATION_JSON);
}
return map;