|
|
@ -1,5 +1,5 @@
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Copyright 2012-2018 the original author or authors.
|
|
|
|
* Copyright 2012-2019 the original author or authors.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
@ -24,11 +24,16 @@ import org.springframework.boot.autoconfigure.AutoConfigureAfter;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication;
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication.Type;
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
|
|
|
|
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.gson.GsonAutoConfiguration;
|
|
|
|
|
|
|
|
import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration.NotReactiveWebApplicationCondition;
|
|
|
|
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
|
|
|
|
import org.springframework.boot.autoconfigure.jsonb.JsonbAutoConfiguration;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
import org.springframework.context.annotation.Bean;
|
|
|
|
|
|
|
|
import org.springframework.context.annotation.Conditional;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import org.springframework.http.converter.HttpMessageConverter;
|
|
|
|
import org.springframework.http.converter.HttpMessageConverter;
|
|
|
@ -49,6 +54,7 @@ import org.springframework.http.converter.StringHttpMessageConverter;
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
@Configuration
|
|
|
|
@Configuration
|
|
|
|
@ConditionalOnClass(HttpMessageConverter.class)
|
|
|
|
@ConditionalOnClass(HttpMessageConverter.class)
|
|
|
|
|
|
|
|
@Conditional(NotReactiveWebApplicationCondition.class)
|
|
|
|
@AutoConfigureAfter({ GsonAutoConfiguration.class, JacksonAutoConfiguration.class,
|
|
|
|
@AutoConfigureAfter({ GsonAutoConfiguration.class, JacksonAutoConfiguration.class,
|
|
|
|
JsonbAutoConfiguration.class })
|
|
|
|
JsonbAutoConfiguration.class })
|
|
|
|
@Import({ JacksonHttpMessageConvertersConfiguration.class,
|
|
|
|
@Import({ JacksonHttpMessageConvertersConfiguration.class,
|
|
|
@ -93,4 +99,17 @@ public class HttpMessageConvertersAutoConfiguration {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static class NotReactiveWebApplicationCondition extends NoneNestedConditions {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
NotReactiveWebApplicationCondition() {
|
|
|
|
|
|
|
|
super(ConfigurationPhase.PARSE_CONFIGURATION);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ConditionalOnWebApplication(type = Type.REACTIVE)
|
|
|
|
|
|
|
|
private static class ReactiveWebApplication {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|