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

Class RequestMappingHandlerMapping

    • Constructor Detail

      • RequestMappingHandlerMapping

        public RequestMappingHandlerMapping()
    • Method Detail

      • setPathPrefixes

        public void setPathPrefixes(java.util.Map<java.lang.String,java.util.function.Predicate<java.lang.Class<?>>> prefixes)
        Configure path prefixes to apply to controller methods.

        Prefixes are used to enrich the mappings of every @RequestMapping method whose controller type is matched by a corresponding Predicate in the map. The prefix for the first matching predicate is used, assuming the input map has predictable order.

        Consider using HandlerTypePredicate to group controllers.

        Parameters:
        prefixes - a map with path prefixes as key
        Since:
        5.1
        See Also:
        HandlerTypePredicate
      • getPathPrefixes

        public java.util.Map<java.lang.String,java.util.function.Predicate<java.lang.Class<?>>> getPathPrefixes()
        The configured path prefixes as a read-only, possibly empty map.
        Since:
        5.1
      • isHandler

        protected boolean isHandler(java.lang.Class<?> beanType)
        Whether the given type is a handler with handler methods. Expects a handler to have a type-level @Controller annotation.
        Specified by:
        isHandler in class AbstractHandlerMethodMapping<RequestMappingInfo>
        Parameters:
        beanType - the type of the bean being checked
        Returns:
        "true" if this a handler type, "false" otherwise.
      • getCustomTypeCondition

        @Nullable
        protected RequestCondition<?> getCustomTypeCondition(java.lang.Class<?> handlerType)
        Provide a custom type-level request condition. The custom RequestCondition can be of any type so long as the same condition type is returned from all calls to this method in order to ensure custom request conditions can be combined and compared.

        Consider extending AbstractRequestCondition for custom condition types and using CompositeRequestCondition to provide multiple custom conditions.

        Parameters:
        handlerType - the handler type for which to create the condition
        Returns:
        the condition, or null
      • getCustomMethodCondition

        @Nullable
        protected RequestCondition<?> getCustomMethodCondition(java.lang.reflect.Method method)
        Provide a custom method-level request condition. The custom RequestCondition can be of any type so long as the same condition type is returned from all calls to this method in order to ensure custom request conditions can be combined and compared.

        Consider extending AbstractRequestCondition for custom condition types and using CompositeRequestCondition to provide multiple custom conditions.

        Parameters:
        method - the handler method for which to create the condition
        Returns:
        the condition, or null
      • resolveEmbeddedValuesInPatterns

        protected java.lang.String[] resolveEmbeddedValuesInPatterns(java.lang.String[] patterns)
        Resolve placeholder values in the given array of patterns.
        Returns:
        a new array with updated patterns