org.springframework.security.config.annotation.web
Class AbstractRequestMatcherConfigurer<B extends SecurityBuilder<O>,C,O>

java.lang.Object
  extended by org.springframework.security.config.annotation.SecurityConfigurerAdapter<O,B>
      extended by org.springframework.security.config.annotation.web.AbstractRequestMatcherConfigurer<B,C,O>
Type Parameters:
B - The Builder that is building Object O and is configured by this AbstractRequestMatcherMappingConfigurer
C - The object that is returned or Chained after creating the RequestMatcher
O - The Object being built by Builder B
All Implemented Interfaces:
SecurityConfigurer<O,B>
Direct Known Subclasses:
AbstractRequestMatcherMappingConfigurer, HttpSecurity.RequestMatcherConfigurer, WebSecurity.IgnoredRequestConfigurer

public abstract class AbstractRequestMatcherConfigurer<B extends SecurityBuilder<O>,C,O>
extends SecurityConfigurerAdapter<O,B>

A base class for registering RequestMatcher's. For example, it might allow for specifying which RequestMatcher require a certain level of authorization.

Since:
3.2

Constructor Summary
AbstractRequestMatcherConfigurer()
           
 
Method Summary
 C antMatchers(HttpMethod method, String... antPatterns)
          Maps a List of AntPathRequestMatcher instances.
 C antMatchers(String... antPatterns)
          Maps a List of AntPathRequestMatcher instances that do not care which HttpMethod is used.
 C anyRequest()
          Maps any request.
protected abstract  C chainRequestMatchers(List<RequestMatcher> requestMatchers)
          Subclasses should implement this method for returning the object that is chained to the creation of the RequestMatcher instances.
 C regexMatchers(HttpMethod method, String... regexPatterns)
          Maps a List of RegexRequestMatcher instances.
 C regexMatchers(String... regexPatterns)
          Create a List of RegexRequestMatcher instances that do not specify an HttpMethod.
 C requestMatchers(RequestMatcher... requestMatchers)
          Associates a list of RequestMatcher instances with the AbstractRequestMatcherMappingConfigurer
 
Methods inherited from class org.springframework.security.config.annotation.SecurityConfigurerAdapter
addObjectPostProcessor, and, configure, getBuilder, init, postProcess, setBuilder
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRequestMatcherConfigurer

public AbstractRequestMatcherConfigurer()
Method Detail

anyRequest

public C anyRequest()
Maps any request.

Parameters:
method - the HttpMethod to use or null for any HttpMethod.
antPatterns - the ant patterns to create AntPathRequestMatcher from
Returns:
the object that is chained after creating the RequestMatcher

antMatchers

public C antMatchers(HttpMethod method,
                     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 AntPathRequestMatcher from
Returns:
the object that is chained after creating the RequestMatcher

antMatchers

public C antMatchers(String... antPatterns)
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

regexMatchers

public C regexMatchers(HttpMethod method,
                       String... regexPatterns)
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

public C regexMatchers(String... regexPatterns)
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

requestMatchers

public C requestMatchers(RequestMatcher... requestMatchers)
Associates a list of RequestMatcher instances with the AbstractRequestMatcherMappingConfigurer

Parameters:
requestMatchers - the RequestMatcher instances
Returns:
the object that is chained after creating the RequestMatcher

chainRequestMatchers

protected abstract C chainRequestMatchers(List<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