diff --git a/spring-test/src/main/java/org/springframework/test/web/servlet/ResultMatcher.java b/spring-test/src/main/java/org/springframework/test/web/servlet/ResultMatcher.java index 332019fb822..35ecd0a43be 100644 --- a/spring-test/src/main/java/org/springframework/test/web/servlet/ResultMatcher.java +++ b/spring-test/src/main/java/org/springframework/test/web/servlet/ResultMatcher.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -51,7 +51,6 @@ public interface ResultMatcher { /** * Assert the result of an executed request. - * * @param result the result of the executed request * @throws Exception if a failure occurs */ diff --git a/spring-web/src/main/java/org/springframework/http/codec/support/BaseDefaultCodecs.java b/spring-web/src/main/java/org/springframework/http/codec/support/BaseDefaultCodecs.java index cdeb47548c9..49c9825b85c 100644 --- a/spring-web/src/main/java/org/springframework/http/codec/support/BaseDefaultCodecs.java +++ b/spring-web/src/main/java/org/springframework/http/codec/support/BaseDefaultCodecs.java @@ -233,7 +233,7 @@ class BaseDefaultCodecs implements CodecConfigurer.DefaultCodecs { } - // Accessors for use in sub-classes... + // Accessors for use in subclasses... protected Decoder> getJackson2JsonDecoder() { return (this.jackson2JsonDecoder != null ? this.jackson2JsonDecoder : new Jackson2JsonDecoder()); diff --git a/spring-web/src/test/java/org/springframework/http/codec/support/CodecConfigurerTests.java b/spring-web/src/test/java/org/springframework/http/codec/support/CodecConfigurerTests.java index 948f5a38d85..4f5aaa60d49 100644 --- a/spring-web/src/test/java/org/springframework/http/codec/support/CodecConfigurerTests.java +++ b/spring-web/src/test/java/org/springframework/http/codec/support/CodecConfigurerTests.java @@ -54,7 +54,8 @@ import static org.mockito.Mockito.*; import static org.springframework.core.ResolvableType.forClass; /** - * Unit tests for {@link BaseCodecConfigurer}. + * Unit tests for {@link BaseDefaultCodecs}. + * * @author Rossen Stoyanchev */ public class CodecConfigurerTests { @@ -294,7 +295,6 @@ public class CodecConfigurerTests { } private static class TestDefaultCodecs extends BaseDefaultCodecs { - } } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java index c636d929a28..3b7b8d42ed6 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/config/WebFluxConfigurationSupport.java @@ -120,13 +120,14 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware { PathMatchConfigurer configurer = getPathMatchConfigurer(); Boolean useTrailingSlashMatch = configurer.isUseTrailingSlashMatch(); - Boolean useCaseSensitiveMatch = configurer.isUseCaseSensitiveMatch(); if (useTrailingSlashMatch != null) { mapping.setUseTrailingSlashMatch(useTrailingSlashMatch); } + Boolean useCaseSensitiveMatch = configurer.isUseCaseSensitiveMatch(); if (useCaseSensitiveMatch != null) { mapping.setUseCaseSensitiveMatch(useCaseSensitiveMatch); } + return mapping; } @@ -316,6 +317,10 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware { return initializer; } + /** + * Return a {@link FormattingConversionService} for use with annotated controllers. + *
See {@link #addFormatters} as an alternative to overriding this method. + */ @Bean public FormattingConversionService webFluxConversionService() { FormattingConversionService service = new DefaultFormattingConversionService(); @@ -324,7 +329,9 @@ public class WebFluxConfigurationSupport implements ApplicationContextAware { } /** - * Override to add custom {@link Converter}s and {@link Formatter}s. + * Override this method to add custom {@link Converter} and/or {@link Formatter} + * delegates to the common {@link FormattingConversionService}. + * @see #webFluxConversionService() */ protected void addFormatters(FormatterRegistry registry) { } diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java index 0dcb74b0878..f2198eaa768 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java @@ -76,8 +76,9 @@ public abstract class RequestPredicates { /** - * Return a {@code RequestPredicate} that tests against the given HTTP method. - * @param httpMethod the HTTP method to match to + * Return a {@code RequestPredicate} that matches if the request's + * HTTP method is equal to the given method. + * @param httpMethod the HTTP method to match against * @return a predicate that tests against the given HTTP method */ public static RequestPredicate method(HttpMethod httpMethod) { @@ -85,7 +86,8 @@ public abstract class RequestPredicates { } /** - * Return a {@code RequestPredicate} that tests the request path against the given path pattern. + * Return a {@code RequestPredicate} that tests the request path + * against the given path pattern. * @param pattern the pattern to match to * @return a predicate that tests against the given path pattern */ @@ -95,20 +97,22 @@ public abstract class RequestPredicates { } /** - * Return a function that creates new path-matching {@code RequestPredicates} from pattern - * Strings using the given {@link PathPatternParser}. This method can be used to specify a - * non-default, customized {@code PathPatternParser} when resolving path patterns. + * Return a function that creates new path-matching {@code RequestPredicates} + * from pattern Strings using the given {@link PathPatternParser}. + *
This method can be used to specify a non-default, customized
+ * {@code PathPatternParser} when resolving path patterns.
* @param patternParser the parser used to parse patterns given to the returned function
- * @return a function that resolves patterns Strings into path-matching
- * {@code RequestPredicate}s
+ * @return a function that resolves a pattern String into a path-matching
+ * {@code RequestPredicates} instance
*/
public static Function See {@link #addFormatters} as an alternative to overriding this method.
*/
@Bean
public FormattingConversionService mvcConversionService() {
@@ -636,7 +635,9 @@ public class WebMvcConfigurationSupport implements ApplicationContextAware, Serv
}
/**
- * Override this method to add custom {@link Converter}s and {@link Formatter}s.
+ * Override this method to add custom {@link Converter} and/or {@link Formatter}
+ * delegates to the common {@link FormattingConversionService}.
+ * @see #mvcConversionService()
*/
protected void addFormatters(FormatterRegistry registry) {
}
diff --git a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
index 565ddeca4e9..382178bb87f 100644
--- a/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
+++ b/spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerMapping.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2002-2017 the original author or authors.
+ * Copyright 2002-2018 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.
@@ -111,6 +111,13 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
this.contentNegotiationManager = contentNegotiationManager;
}
+ /**
+ * Return the configured {@link ContentNegotiationManager}.
+ */
+ public ContentNegotiationManager getContentNegotiationManager() {
+ return this.contentNegotiationManager;
+ }
+
@Override
public void setEmbeddedValueResolver(StringValueResolver resolver) {
this.embeddedValueResolver = resolver;
@@ -151,13 +158,6 @@ public class RequestMappingHandlerMapping extends RequestMappingInfoHandlerMappi
return this.useTrailingSlashMatch;
}
- /**
- * Return the configured {@link ContentNegotiationManager}.
- */
- public ContentNegotiationManager getContentNegotiationManager() {
- return this.contentNegotiationManager;
- }
-
/**
* Return the file extensions to use for suffix pattern matching.
*/