org.springframework.web.reactive.function.server.support

Class RouterFunctionMapping

    • Constructor Detail

      • RouterFunctionMapping

        public RouterFunctionMapping()
        Create an empty RouterFunctionMapping.

        If this constructor is used, this mapping will detect all RouterFunction instances available in the application context.

      • RouterFunctionMapping

        public RouterFunctionMapping(RouterFunction<?> routerFunction)
        Create a RouterFunctionMapping with the given RouterFunction.

        If this constructor is used, no application context detection will occur.

        Parameters:
        routerFunction - the router function to use for mapping
    • Method Detail

      • getRouterFunction

        @Nullable
        public RouterFunction<?> getRouterFunction()
        Return the configured RouterFunction.

        Note: When router functions are detected from the ApplicationContext, this method may return null if invoked prior to afterPropertiesSet().

        Returns:
        the router function or null
      • 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 the ServerCodecConfigurer's defaults.

      • 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
      • initRouterFunctions

        protected void initRouterFunctions()
        Initialized the router functions by detecting them in the application context.