public class RequestMappingHandlerAdapter extends Object implements HandlerAdapter, org.springframework.context.ApplicationContextAware, org.springframework.beans.factory.InitializingBean
@RequestMapping
handler methods.| Constructor and Description |
|---|
RequestMappingHandlerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
ArgumentResolverConfigurer |
getArgumentResolverConfigurer()
Return the configured resolvers for controller method arguments.
|
List<org.springframework.http.codec.HttpMessageReader<?>> |
getMessageReaders()
Return the configurer for HTTP message readers.
|
org.springframework.core.ReactiveAdapterRegistry |
getReactiveAdapterRegistry()
Return the configured registry for adapting reactive types.
|
org.springframework.web.bind.support.WebBindingInitializer |
getWebBindingInitializer()
Return the configured WebBindingInitializer, or
null if none. |
reactor.core.publisher.Mono<HandlerResult> |
handle(org.springframework.web.server.ServerWebExchange exchange,
Object handler)
Handle the request with the given handler.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
A
ConfigurableApplicationContext is expected for resolving
expressions in method argument default values as well as for
detecting @ControllerAdvice beans. |
void |
setArgumentResolverConfigurer(ArgumentResolverConfigurer configurer)
Configure resolvers for controller method arguments.
|
void |
setMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
Configure HTTP message readers to de-serialize the request body with.
|
void |
setReactiveAdapterRegistry(org.springframework.core.ReactiveAdapterRegistry registry)
Configure the registry for adapting various reactive types.
|
void |
setWebBindingInitializer(org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)
Provide a WebBindingInitializer with "global" initialization to apply
to every DataBinder instance.
|
boolean |
supports(Object handler)
Whether this
HandlerAdapter supports the given handler. |
public void setMessageReaders(List<org.springframework.http.codec.HttpMessageReader<?>> messageReaders)
By default this is set to ServerCodecConfigurer's readers with defaults.
public List<org.springframework.http.codec.HttpMessageReader<?>> getMessageReaders()
public void setWebBindingInitializer(@Nullable
org.springframework.web.bind.support.WebBindingInitializer webBindingInitializer)
@Nullable public org.springframework.web.bind.support.WebBindingInitializer getWebBindingInitializer()
null if none.public void setArgumentResolverConfigurer(@Nullable
ArgumentResolverConfigurer configurer)
@Nullable public ArgumentResolverConfigurer getArgumentResolverConfigurer()
public void setReactiveAdapterRegistry(@Nullable
org.springframework.core.ReactiveAdapterRegistry registry)
By default this is an instance of ReactiveAdapterRegistry with
default settings.
@Nullable public org.springframework.core.ReactiveAdapterRegistry getReactiveAdapterRegistry()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
ConfigurableApplicationContext is expected for resolving
expressions in method argument default values as well as for
detecting @ControllerAdvice beans.setApplicationContext in interface org.springframework.context.ApplicationContextAwarepublic void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionpublic boolean supports(Object handler)
HandlerAdapterHandlerAdapter supports the given handler.supports in interface HandlerAdapterhandler - the handler object to checkpublic reactor.core.publisher.Mono<HandlerResult> handle(org.springframework.web.server.ServerWebExchange exchange, Object handler)
HandlerAdapterImplementations are encouraged to handle exceptions resulting from the invocation of a handler in order and if necessary to return an alternate result that represents an error response.
Furthermore since an async HandlerResult may produce an error
later during result handling implementations are also encouraged to
set an exception
handler on the HandlerResult so that may also be applied later
after result handling.
handle in interface HandlerAdapterexchange - current server exchangehandler - the selected handler which must have been previously
checked via HandlerAdapter.supports(Object)Mono that emits a single HandlerResult or none if
the request has been fully handled and doesn't require further handling.