Polishing

This commit is contained in:
Juergen Hoeller
2017-11-21 15:25:33 +01:00
parent f3b8d7138c
commit f09e252417
9 changed files with 109 additions and 88 deletions

View File

@@ -156,23 +156,30 @@ class AnnotationDrivenBeanDefinitionParser implements BeanDefinitionParser {
public static final String CONTENT_NEGOTIATION_MANAGER_BEAN_NAME = "mvcContentNegotiationManager";
private static final boolean javaxValidationPresent =
ClassUtils.isPresent("javax.validation.Validator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("javax.validation.Validator",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
private static boolean romePresent =
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
private static final boolean jaxb2Present =
ClassUtils.isPresent("javax.xml.bind.Binder", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("javax.xml.bind.Binder",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
private static final boolean jackson2Present =
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", AnnotationDrivenBeanDefinitionParser.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
private static final boolean jackson2XmlPresent =
ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
private static final boolean gsonPresent =
ClassUtils.isPresent("com.google.gson.Gson", AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
ClassUtils.isPresent("com.google.gson.Gson",
AnnotationDrivenBeanDefinitionParser.class.getClassLoader());
@Override

View File

@@ -174,20 +174,26 @@ import org.springframework.web.util.UrlPathHelper;
public class WebMvcConfigurationSupport implements ApplicationContextAware, ServletContextAware {
private static boolean romePresent =
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed", WebMvcConfigurationSupport.class.getClassLoader());
ClassUtils.isPresent("com.rometools.rome.feed.WireFeed",
WebMvcConfigurationSupport.class.getClassLoader());
private static final boolean jaxb2Present =
ClassUtils.isPresent("javax.xml.bind.Binder", WebMvcConfigurationSupport.class.getClassLoader());
ClassUtils.isPresent("javax.xml.bind.Binder",
WebMvcConfigurationSupport.class.getClassLoader());
private static final boolean jackson2Present =
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper", WebMvcConfigurationSupport.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator", WebMvcConfigurationSupport.class.getClassLoader());
ClassUtils.isPresent("com.fasterxml.jackson.databind.ObjectMapper",
WebMvcConfigurationSupport.class.getClassLoader()) &&
ClassUtils.isPresent("com.fasterxml.jackson.core.JsonGenerator",
WebMvcConfigurationSupport.class.getClassLoader());
private static final boolean jackson2XmlPresent =
ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper", WebMvcConfigurationSupport.class.getClassLoader());
ClassUtils.isPresent("com.fasterxml.jackson.dataformat.xml.XmlMapper",
WebMvcConfigurationSupport.class.getClassLoader());
private static final boolean gsonPresent =
ClassUtils.isPresent("com.google.gson.Gson", WebMvcConfigurationSupport.class.getClassLoader());
ClassUtils.isPresent("com.google.gson.Gson",
WebMvcConfigurationSupport.class.getClassLoader());
private ApplicationContext applicationContext;