Class AbstractRequestMatcherRegistry<C>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      C antMatchers​(java.lang.String... antPatterns)
      Deprecated.
      C antMatchers​(org.springframework.http.HttpMethod method)
      Deprecated.
      C antMatchers​(org.springframework.http.HttpMethod method, java.lang.String... antPatterns)
      C anyRequest()
      Maps any request.
      protected abstract C chainRequestMatchers​(java.util.List<org.springframework.security.web.util.matcher.RequestMatcher> requestMatchers)
      Subclasses should implement this method for returning the object that is chained to the creation of the RequestMatcher instances.
      protected java.util.List<org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher> createMvcMatchers​(org.springframework.http.HttpMethod method, java.lang.String... mvcPatterns)
      Creates MvcRequestMatcher instances for the method and patterns passed in
      C dispatcherTypeMatchers​(javax.servlet.DispatcherType... dispatcherTypes)
      Create a List of DispatcherTypeRequestMatcher instances that do not specify an HttpMethod.
      C dispatcherTypeMatchers​(org.springframework.http.HttpMethod method, javax.servlet.DispatcherType... dispatcherTypes)
      Maps a List of DispatcherTypeRequestMatcher instances.
      protected org.springframework.context.ApplicationContext getApplicationContext()
      Gets the ApplicationContext
      abstract C mvcMatchers​(java.lang.String... mvcPatterns)
      Deprecated.
      abstract C mvcMatchers​(org.springframework.http.HttpMethod method, java.lang.String... mvcPatterns)
      C regexMatchers​(java.lang.String... regexPatterns)
      Deprecated.
      use requestMatchers(RequestMatcher...) with a RegexRequestMatcher instead
      C regexMatchers​(org.springframework.http.HttpMethod method, java.lang.String... regexPatterns)
      Deprecated.
      use requestMatchers(RequestMatcher...) with a RegexRequestMatcher instead
      C requestMatchers​(java.lang.String... patterns)
      If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that does not care which HttpMethod is used.
      C requestMatchers​(org.springframework.http.HttpMethod method)
      If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that matches on a specific HttpMethod.
      C requestMatchers​(org.springframework.http.HttpMethod method, java.lang.String... patterns)
      If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that also specifies a specific HttpMethod to match on.
      C requestMatchers​(org.springframework.security.web.util.matcher.RequestMatcher... requestMatchers)
      Associates a list of RequestMatcher instances with the AbstractConfigAttributeRequestMatcherRegistry
      protected void setApplicationContext​(org.springframework.context.ApplicationContext context)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractRequestMatcherRegistry

        public AbstractRequestMatcherRegistry()
    • Method Detail

      • setApplicationContext

        protected final void setApplicationContext​(org.springframework.context.ApplicationContext context)
      • getApplicationContext

        protected final org.springframework.context.ApplicationContext getApplicationContext()
        Gets the ApplicationContext
        Returns:
        the ApplicationContext
      • anyRequest

        public C anyRequest()
        Maps any request.
        Returns:
        the object that is chained after creating the RequestMatcher
      • antMatchers

        @Deprecated
        public C antMatchers​(org.springframework.http.HttpMethod method)
        Deprecated.
        Maps a List of AntPathRequestMatcher instances.
        Parameters:
        method - the HttpMethod to use for any HttpMethod.
        Returns:
        the object that is chained after creating the RequestMatcher
      • antMatchers

        @Deprecated
        public C antMatchers​(org.springframework.http.HttpMethod method,
                             java.lang.String... antPatterns)
        Maps a List of AntPathRequestMatcher instances.
        Parameters:
        method - the HttpMethod to use or null for any HttpMethod.
        antPatterns - the ant patterns to create. If null or empty, then matches on nothing.
        Returns:
        the object that is chained after creating the RequestMatcher
      • antMatchers

        @Deprecated
        public C antMatchers​(java.lang.String... antPatterns)
        Deprecated.
        Maps a List of AntPathRequestMatcher instances that do not care which HttpMethod is used.
        Parameters:
        antPatterns - the ant patterns to create AntPathRequestMatcher from
        Returns:
        the object that is chained after creating the RequestMatcher
      • mvcMatchers

        @Deprecated
        public abstract C mvcMatchers​(java.lang.String... mvcPatterns)
        Deprecated.

        Maps an MvcRequestMatcher that does not care which HttpMethod is used. This matcher will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc.

        If the current request will not be processed by Spring MVC, a reasonable default using the pattern as a ant pattern will be used.

        Parameters:
        mvcPatterns - the patterns to match on. The rules for matching are defined by Spring MVC
        Returns:
        the object that is chained after creating the RequestMatcher.
      • mvcMatchers

        @Deprecated
        public abstract C mvcMatchers​(org.springframework.http.HttpMethod method,
                                      java.lang.String... mvcPatterns)

        Maps an MvcRequestMatcher that also specifies a specific HttpMethod to match on. This matcher will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc.

        If the current request will not be processed by Spring MVC, a reasonable default using the pattern as a ant pattern will be used.

        Parameters:
        method - the HTTP method to match on
        mvcPatterns - the patterns to match on. The rules for matching are defined by Spring MVC
        Returns:
        the object that is chained after creating the RequestMatcher.
      • createMvcMatchers

        protected final java.util.List<org.springframework.security.web.servlet.util.matcher.MvcRequestMatcher> createMvcMatchers​(org.springframework.http.HttpMethod method,
                                                                                                                                  java.lang.String... mvcPatterns)
        Creates MvcRequestMatcher instances for the method and patterns passed in
        Parameters:
        method - the HTTP method to use or null if any should be used
        mvcPatterns - the Spring MVC patterns to match on
        Returns:
        a List of MvcRequestMatcher instances
      • regexMatchers

        @Deprecated
        public C regexMatchers​(org.springframework.http.HttpMethod method,
                               java.lang.String... regexPatterns)
        Deprecated.
        use requestMatchers(RequestMatcher...) with a RegexRequestMatcher instead
        Maps a List of RegexRequestMatcher instances.
        Parameters:
        method - the HttpMethod to use or null for any HttpMethod.
        regexPatterns - the regular expressions to create RegexRequestMatcher from
        Returns:
        the object that is chained after creating the RequestMatcher
      • regexMatchers

        @Deprecated
        public C regexMatchers​(java.lang.String... regexPatterns)
        Deprecated.
        use requestMatchers(RequestMatcher...) with a RegexRequestMatcher instead
        Create a List of RegexRequestMatcher instances that do not specify an HttpMethod.
        Parameters:
        regexPatterns - the regular expressions to create RegexRequestMatcher from
        Returns:
        the object that is chained after creating the RequestMatcher
      • dispatcherTypeMatchers

        public C dispatcherTypeMatchers​(@Nullable
                                        org.springframework.http.HttpMethod method,
                                        javax.servlet.DispatcherType... dispatcherTypes)
        Maps a List of DispatcherTypeRequestMatcher instances.
        Parameters:
        method - the HttpMethod to use or null for any HttpMethod.
        dispatcherTypes - the dispatcher types to match against
        Returns:
        the object that is chained after creating the RequestMatcher
      • dispatcherTypeMatchers

        public C dispatcherTypeMatchers​(javax.servlet.DispatcherType... dispatcherTypes)
        Create a List of DispatcherTypeRequestMatcher instances that do not specify an HttpMethod.
        Parameters:
        dispatcherTypes - the dispatcher types to match against
        Returns:
        the object that is chained after creating the RequestMatcher
      • requestMatchers

        public C requestMatchers​(org.springframework.security.web.util.matcher.RequestMatcher... requestMatchers)
        Associates a list of RequestMatcher instances with the AbstractConfigAttributeRequestMatcherRegistry
        Parameters:
        requestMatchers - the RequestMatcher instances
        Returns:
        the object that is chained after creating the RequestMatcher
      • requestMatchers

        public C requestMatchers​(org.springframework.http.HttpMethod method,
                                 java.lang.String... patterns)

        If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that also specifies a specific HttpMethod to match on. This matcher will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the HandlerMappingIntrospector is not available, maps to an AntPathRequestMatcher.

        If a specific RequestMatcher must be specified, use requestMatchers(RequestMatcher...) instead

        Parameters:
        method - the HttpMethod to use or null for any HttpMethod.
        patterns - the patterns to match on. The rules for matching are defined by Spring MVC if MvcRequestMatcher is used
        Returns:
        the object that is chained after creating the RequestMatcher.
        Since:
        5.8
      • requestMatchers

        public C requestMatchers​(java.lang.String... patterns)

        If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that does not care which HttpMethod is used. This matcher will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the HandlerMappingIntrospector is not available, maps to an AntPathRequestMatcher.

        If a specific RequestMatcher must be specified, use requestMatchers(RequestMatcher...) instead

        Parameters:
        patterns - the patterns to match on. The rules for matching are defined by Spring MVC if MvcRequestMatcher is used
        Returns:
        the object that is chained after creating the RequestMatcher.
        Since:
        5.8
      • requestMatchers

        public C requestMatchers​(org.springframework.http.HttpMethod method)

        If the HandlerMappingIntrospector is available in the classpath, maps to an MvcRequestMatcher that matches on a specific HttpMethod. This matcher will use the same rules that Spring MVC uses for matching. For example, often times a mapping of the path "/path" will match on "/path", "/path/", "/path.html", etc. If the HandlerMappingIntrospector is not available, maps to an AntPathRequestMatcher.

        If a specific RequestMatcher must be specified, use requestMatchers(RequestMatcher...) instead

        Parameters:
        method - the HttpMethod to use or null for any HttpMethod.
        Returns:
        the object that is chained after creating the RequestMatcher.
        Since:
        5.8
      • chainRequestMatchers

        protected abstract C chainRequestMatchers​(java.util.List<org.springframework.security.web.util.matcher.RequestMatcher> requestMatchers)
        Subclasses should implement this method for returning the object that is chained to the creation of the RequestMatcher instances.
        Parameters:
        requestMatchers - the RequestMatcher instances that were created
        Returns:
        the chained Object for the subclass which allows association of something else to the RequestMatcher