28
28
29
29
/**
30
30
* Defines callback methods to customize the configuration for WebFlux
31
- * applications enabled via {@code @EnableWebFlux}.
31
+ * applications enabled via {@link EnableWebFlux @EnableWebFlux}.
32
32
*
33
33
* <p>{@code @EnableWebFlux}-annotated configuration classes may implement
34
34
* this interface to be called back and given a chance to customize the
38
38
* @author Brian Clozel
39
39
* @author Rossen Stoyanchev
40
40
* @since 5.0
41
+ * @see WebFluxConfigurationSupport
42
+ * @see DelegatingWebFluxConfiguration
41
43
*/
42
44
public interface WebFluxConfigurer {
43
45
44
46
/**
45
- * Configure how the content type requested for the response is resolved.
47
+ * Configure how the content type requested for the response is resolved
48
+ * when handling reqests with annotated controllers.
46
49
* @param builder for configuring the resolvers to use
47
50
*/
48
51
default void configureContentTypeResolver (RequestedContentTypeResolverBuilder builder ) {
49
52
}
50
53
51
54
/**
52
- * Configure cross origin requests processing.
55
+ * Configure "global" cross origin request processing.
56
+ * <p>The configured readers and writers will apply to all requests including
57
+ * annotated controllers and functional endpoints. Annotated controllers can
58
+ * further declare more fine-grained configuration via
59
+ * {@link org.springframework.web.bind.annotation.CrossOrigin @CrossOrigin}.
53
60
* @see CorsRegistry
54
61
*/
55
62
default void addCorsMappings (CorsRegistry registry ) {
56
63
}
57
64
58
65
/**
59
66
* Configure path matching options.
60
- *
61
- * {@code HandlerMapping}s with path matching options.
67
+ * <p>The configured path matching options will be used for mapping to
68
+ * annotated controllers and also
69
+ * {@link #addResourceHandlers(ResourceHandlerRegistry) static resources}.
62
70
* @param configurer the {@link PathMatchConfigurer} instance
63
71
*/
64
72
default void configurePathMatching (PathMatchConfigurer configurer ) {
@@ -72,22 +80,24 @@ default void addResourceHandlers(ResourceHandlerRegistry registry) {
72
80
}
73
81
74
82
/**
75
- * Configure resolvers for custom controller method arguments.
83
+ * Configure resolvers for custom {@code @RequestMapping} method arguments.
76
84
* @param configurer to configurer to use
77
85
*/
78
86
default void configureArgumentResolvers (ArgumentResolverConfigurer configurer ) {
79
87
}
80
88
81
89
/**
82
90
* Configure custom HTTP message readers and writers or override built-in ones.
91
+ * <p>The configured readers and writers will be used for both annotated
92
+ * controllers and functional endpoints.
83
93
* @param configurer the configurer to use
84
94
*/
85
95
default void configureHttpMessageCodecs (ServerCodecConfigurer configurer ) {
86
96
}
87
97
88
98
/**
89
99
* Add custom {@link Converter}s and {@link Formatter}s for performing type
90
- * conversion and formatting of controller method arguments.
100
+ * conversion and formatting of annotated controller method arguments.
91
101
*/
92
102
default void addFormatters (FormatterRegistry registry ) {
93
103
}
@@ -96,30 +106,30 @@ default void addFormatters(FormatterRegistry registry) {
96
106
* Provide a custom {@link Validator}.
97
107
* <p>By default a validator for standard bean validation is created if
98
108
* bean validation api is present on the classpath.
109
+ * <p>The configured validator is used for validating annotated controller
110
+ * method arguments.
99
111
*/
100
112
@ Nullable
101
113
default Validator getValidator () {
102
114
return null ;
103
115
}
104
116
105
117
/**
106
- * Provide a custom {@link MessageCodesResolver} to use for data binding instead
107
- * of the one created by default in {@link org.springframework.validation.DataBinder}.
118
+ * Provide a custom {@link MessageCodesResolver} to use for data binding in
119
+ * annotated controller method arguments instead of the one created by
120
+ * default in {@link org.springframework.validation.DataBinder}.
108
121
*/
109
122
@ Nullable
110
123
default MessageCodesResolver getMessageCodesResolver () {
111
124
return null ;
112
125
}
113
126
114
127
/**
115
- * Configure view resolution for processing the return values of controller
116
- * methods that rely on resolving a
117
- * {@link org.springframework.web.reactive.result.view.View} to render
118
- * the response with. By default all controller methods rely on view
119
- * resolution unless annotated with {@code @ResponseBody} or explicitly
120
- * return {@code ResponseEntity}. A view may be specified explicitly with
121
- * a String return value or implicitly, e.g. {@code void} return value.
122
- * @see ViewResolverRegistry
128
+ * Configure view resolution for rendering responses with a view and a model,
129
+ * where the view is typically an HTML template but could also be based on
130
+ * an HTTP message writer (e.g. JSON, XML).
131
+ * <p>The configured view resolvers will be used for both annotated
132
+ * controllers and functional endpoints.
123
133
*/
124
134
default void configureViewResolvers (ViewResolverRegistry registry ) {
125
135
}
0 commit comments