public class WebFluxConfigurerComposite extends Object implements WebFluxConfigurer
WebFluxConfigurer
that delegates to one or more others.Constructor and Description |
---|
WebFluxConfigurerComposite() |
Modifier and Type | Method and Description |
---|---|
void |
addCorsMappings(CorsRegistry registry)
Configure "global" cross origin request processing.
|
void |
addFormatters(FormatterRegistry registry)
Add custom
Converters and Formatters for
performing type conversion and formatting of annotated controller method arguments. |
void |
addResourceHandlers(ResourceHandlerRegistry registry)
Add resource handlers for serving static resources.
|
void |
addWebFluxConfigurers(List<WebFluxConfigurer> configurers) |
void |
configureArgumentResolvers(ArgumentResolverConfigurer configurer)
Configure resolvers for custom
@RequestMapping method arguments. |
void |
configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
Configure how the content type requested for the response is resolved
when handling requests with annotated controllers.
|
void |
configureHttpMessageCodecs(ServerCodecConfigurer configurer)
Configure the HTTP message readers and writers for reading from the
request body and for writing to the response body in annotated controllers
and functional endpoints.
|
void |
configurePathMatching(PathMatchConfigurer configurer)
Configure path matching options.
|
void |
configureViewResolvers(ViewResolverRegistry registry)
Configure view resolution for rendering responses with a view and a model,
where the view is typically an HTML template but could also be based on
an HTTP message writer (e.g.
|
MessageCodesResolver |
getMessageCodesResolver()
Provide a custom
MessageCodesResolver to use for data binding in
annotated controller method arguments instead of the one created by
default in DataBinder . |
Validator |
getValidator()
Provide a custom
Validator . |
WebSocketService |
getWebSocketService()
Provide the
WebSocketService to create
WebSocketHandlerAdapter
with. |
public void addWebFluxConfigurers(List<WebFluxConfigurer> configurers)
public void configureContentTypeResolver(RequestedContentTypeResolverBuilder builder)
WebFluxConfigurer
configureContentTypeResolver
in interface WebFluxConfigurer
builder
- for configuring the resolvers to usepublic void addCorsMappings(CorsRegistry registry)
WebFluxConfigurer
Annotated controllers can further declare more fine-grained config via
@CrossOrigin
.
In such cases "global" CORS configuration declared here is
combined
with local CORS configuration defined on a controller method.
addCorsMappings
in interface WebFluxConfigurer
CorsRegistry
,
CorsConfiguration.combine(CorsConfiguration)
public void configurePathMatching(PathMatchConfigurer configurer)
WebFluxConfigurer
The configured path matching options will be used for mapping to
annotated controllers and also
static resources
.
configurePathMatching
in interface WebFluxConfigurer
configurer
- the PathMatchConfigurer
instancepublic void addResourceHandlers(ResourceHandlerRegistry registry)
WebFluxConfigurer
addResourceHandlers
in interface WebFluxConfigurer
ResourceHandlerRegistry
@Nullable public WebSocketService getWebSocketService()
WebFluxConfigurer
WebSocketService
to create
WebSocketHandlerAdapter
with. This can be used to configure server-specific properties through the
RequestUpgradeStrategy
.getWebSocketService
in interface WebFluxConfigurer
public void configureArgumentResolvers(ArgumentResolverConfigurer configurer)
WebFluxConfigurer
@RequestMapping
method arguments.configureArgumentResolvers
in interface WebFluxConfigurer
configurer
- to configurer to usepublic void configureHttpMessageCodecs(ServerCodecConfigurer configurer)
WebFluxConfigurer
By default, all built-in readers and writers are configured as long as the corresponding 3rd party libraries such Jackson JSON, JAXB2, and others are present on the classpath.
configureHttpMessageCodecs
in interface WebFluxConfigurer
configurer
- the configurer to customize readers and writerspublic void addFormatters(FormatterRegistry registry)
WebFluxConfigurer
Converters
and Formatters
for
performing type conversion and formatting of annotated controller method arguments.addFormatters
in interface WebFluxConfigurer
public Validator getValidator()
WebFluxConfigurer
Validator
.
By default a validator for standard bean validation is created if bean validation API is present on the classpath.
The configured validator is used for validating annotated controller method arguments.
getValidator
in interface WebFluxConfigurer
public MessageCodesResolver getMessageCodesResolver()
WebFluxConfigurer
MessageCodesResolver
to use for data binding in
annotated controller method arguments instead of the one created by
default in DataBinder
.getMessageCodesResolver
in interface WebFluxConfigurer
public void configureViewResolvers(ViewResolverRegistry registry)
WebFluxConfigurer
The configured view resolvers will be used for both annotated controllers and functional endpoints.
configureViewResolvers
in interface WebFluxConfigurer