C
- The object that is returned or Chained after creating the RequestMatcherpublic abstract class AbstractRequestMatcherRegistry<C> extends Object
RequestMatcher
's. For example, it might allow for
specifying which RequestMatcher
require a certain level of authorization.Constructor and Description |
---|
AbstractRequestMatcherRegistry() |
Modifier and Type | Method and Description |
---|---|
C |
antMatchers(HttpMethod method)
Maps a
List of
AntPathRequestMatcher
instances. |
C |
antMatchers(HttpMethod method,
String... antPatterns)
Maps a
List of
AntPathRequestMatcher
instances. |
C |
antMatchers(String... antPatterns)
|
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. |
protected List<MvcRequestMatcher> |
createMvcMatchers(HttpMethod method,
String... mvcPatterns)
Creates
MvcRequestMatcher instances for the method and patterns passed in |
protected ApplicationContext |
getApplicationContext()
Gets the
ApplicationContext |
abstract C |
mvcMatchers(HttpMethod method,
String... mvcPatterns)
Maps an
MvcRequestMatcher that also specifies a specific HttpMethod
to match on. |
abstract C |
mvcMatchers(String... mvcPatterns)
Maps an
MvcRequestMatcher that does not care which HttpMethod is
used. |
C |
regexMatchers(HttpMethod method,
String... regexPatterns)
Maps a
List of
RegexRequestMatcher
instances. |
C |
regexMatchers(String... regexPatterns)
|
C |
requestMatchers(RequestMatcher... requestMatchers)
Associates a list of
RequestMatcher instances with the
AbstractConfigAttributeRequestMatcherRegistry |
protected void |
setApplicationContext(ApplicationContext context) |
protected final void setApplicationContext(ApplicationContext context)
protected final ApplicationContext getApplicationContext()
ApplicationContext
ApplicationContext
public C anyRequest()
RequestMatcher
public C antMatchers(HttpMethod method)
List
of
AntPathRequestMatcher
instances.method
- the HttpMethod
to use for any
HttpMethod
.RequestMatcher
public C antMatchers(HttpMethod method, String... antPatterns)
List
of
AntPathRequestMatcher
instances.method
- the HttpMethod
to use or null
for any
HttpMethod
.antPatterns
- the ant patterns to create. If null
or empty, then matches on nothing.
AntPathRequestMatcher
fromRequestMatcher
public C antMatchers(String... antPatterns)
antPatterns
- the ant patterns to create
AntPathRequestMatcher
fromRequestMatcher
public abstract C mvcMatchers(String... mvcPatterns)
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.
mvcPatterns
- the patterns to match on. The rules for matching are defined by
Spring MVCRequestMatcher
.public abstract C mvcMatchers(HttpMethod method, 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.
method
- the HTTP method to match onmvcPatterns
- the patterns to match on. The rules for matching are defined by
Spring MVCRequestMatcher
.protected final List<MvcRequestMatcher> createMvcMatchers(HttpMethod method, String... mvcPatterns)
MvcRequestMatcher
instances for the method and patterns passed inmethod
- the HTTP method to use or null if any should be usedmvcPatterns
- the Spring MVC patterns to match onMvcRequestMatcher
instancespublic C regexMatchers(HttpMethod method, String... regexPatterns)
List
of
RegexRequestMatcher
instances.method
- the HttpMethod
to use or null
for any
HttpMethod
.regexPatterns
- the regular expressions to create
RegexRequestMatcher
fromRequestMatcher
public C regexMatchers(String... regexPatterns)
regexPatterns
- the regular expressions to create
RegexRequestMatcher
fromRequestMatcher
public C requestMatchers(RequestMatcher... requestMatchers)
RequestMatcher
instances with the
AbstractConfigAttributeRequestMatcherRegistry
requestMatchers
- the RequestMatcher
instancesRequestMatcher
protected abstract C chainRequestMatchers(List<RequestMatcher> requestMatchers)
RequestMatcher
instances.requestMatchers
- the RequestMatcher
instances that were createdRequestMatcher