org.springframework.web.reactive.result.method.annotation

Class RequestMappingHandlerAdapter

  • java.lang.Object
    • org.springframework.web.reactive.result.method.annotation.RequestMappingHandlerAdapter
    • Constructor Detail

      • RequestMappingHandlerAdapter

        public RequestMappingHandlerAdapter()
    • Method Detail

      • setMessageReaders

        public void setMessageReaders(java.util.List<HttpMessageReader<?>> messageReaders)
        Configure HTTP message readers to de-serialize the request body with.

        By default this is set to ServerCodecConfigurer's readers with defaults.

      • getMessageReaders

        public java.util.List<HttpMessageReader<?>> getMessageReaders()
        Return the configurer for HTTP message readers.
      • setWebBindingInitializer

        public void setWebBindingInitializer(@Nullable
                                             WebBindingInitializer webBindingInitializer)
        Provide a WebBindingInitializer with "global" initialization to apply to every DataBinder instance.
      • getWebBindingInitializer

        @Nullable
        public WebBindingInitializer getWebBindingInitializer()
        Return the configured WebBindingInitializer, or null if none.
      • setArgumentResolverConfigurer

        public void setArgumentResolverConfigurer(@Nullable
                                                  ArgumentResolverConfigurer configurer)
        Configure resolvers for controller method arguments.
      • getReactiveAdapterRegistry

        @Nullable
        public ReactiveAdapterRegistry getReactiveAdapterRegistry()
        Return the configured registry for adapting reactive types.
      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws java.lang.Exception
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
        Throws:
        java.lang.Exception - in the event of misconfiguration (such as failure to set an essential property) or if initialization fails for any other reason
      • supports

        public boolean supports(java.lang.Object handler)
        Description copied from interface: HandlerAdapter
        Whether this HandlerAdapter supports the given handler.
        Specified by:
        supports in interface HandlerAdapter
        Parameters:
        handler - handler object to check
        Returns:
        whether or not the handler is supported
      • handle

        public reactor.core.publisher.Mono<HandlerResult> handle(ServerWebExchange exchange,
                                                                 java.lang.Object handler)
        Description copied from interface: HandlerAdapter
        Handle the request with the given handler.

        Implementations 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.

        Specified by:
        handle in interface HandlerAdapter
        Parameters:
        exchange - current server exchange
        handler - the selected handler which must have been previously checked via HandlerAdapter.supports(Object)
        Returns:
        Mono that emits a single HandlerResult or none if the request has been fully handled and doesn't require further handling.