|
14 | 14 | * limitations under the License. |
15 | 15 | */ |
16 | 16 |
|
17 | | -package org.springframework.boot.autoconfigure.hateoas; |
| 17 | +package org.springframework.boot.hateoas.autoconfigure; |
18 | 18 |
|
19 | 19 | import com.fasterxml.jackson.databind.ObjectMapper; |
20 | 20 |
|
|
24 | 24 | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
25 | 25 | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; |
26 | 26 | import org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication; |
27 | | -import org.springframework.boot.autoconfigure.data.rest.RepositoryRestMvcAutoConfiguration; |
28 | | -import org.springframework.boot.autoconfigure.http.HttpMessageConvertersAutoConfiguration; |
29 | | -import org.springframework.boot.autoconfigure.web.servlet.WebMvcAutoConfiguration; |
30 | 27 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
31 | 28 | import org.springframework.context.annotation.Bean; |
32 | 29 | import org.springframework.context.annotation.Configuration; |
|
47 | 44 | * @author Roy Clarkson |
48 | 45 | * @author Oliver Gierke |
49 | 46 | * @author Andy Wilkinson |
50 | | - * @since 1.1.0 |
| 47 | + * @since 4.0.0 |
51 | 48 | */ |
52 | | -@AutoConfiguration( |
53 | | - after = { WebMvcAutoConfiguration.class, HttpMessageConvertersAutoConfiguration.class, |
54 | | - RepositoryRestMvcAutoConfiguration.class }, |
55 | | - afterName = "org.springframework.boot.jackson.autoconfigure.JacksonAutoConfiguration") |
56 | | -@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class }) |
| 49 | +@AutoConfiguration |
| 50 | +@ConditionalOnClass({ EntityModel.class, RequestMapping.class, RequestMappingHandlerAdapter.class, Plugin.class, |
| 51 | + ObjectMapper.class }) |
57 | 52 | @ConditionalOnWebApplication |
58 | 53 | @EnableConfigurationProperties(HateoasProperties.class) |
59 | 54 | public class HypermediaAutoConfiguration { |
60 | 55 |
|
61 | 56 | @Bean |
62 | 57 | @ConditionalOnMissingBean |
63 | | - @ConditionalOnClass(name = "com.fasterxml.jackson.databind.ObjectMapper") |
64 | 58 | @ConditionalOnBooleanProperty(name = "spring.hateoas.use-hal-as-default-json-media-type", matchIfMissing = true) |
65 | 59 | HalConfiguration applicationJsonHalConfiguration() { |
66 | 60 | return new HalConfiguration().withMediaType(MediaType.APPLICATION_JSON); |
67 | 61 | } |
68 | 62 |
|
69 | 63 | @Configuration(proxyBeanMethods = false) |
70 | 64 | @ConditionalOnMissingBean(LinkDiscoverers.class) |
71 | | - @ConditionalOnClass(ObjectMapper.class) |
72 | 65 | @EnableHypermediaSupport(type = HypermediaType.HAL) |
73 | | - protected static class HypermediaConfiguration { |
| 66 | + static class HypermediaConfiguration { |
74 | 67 |
|
75 | 68 | } |
76 | 69 |
|
|
0 commit comments