Class AbstractRequestMatcherRegistry<C>
java.lang.Object
org.springframework.security.config.annotation.web.AbstractRequestMatcherRegistry<C>
- Type Parameters:
C- The object that is returned or Chained after creating the RequestMatcher
- Direct Known Subclasses:
AbstractConfigAttributeRequestMatcherRegistry,AuthorizeHttpRequestsConfigurer.AuthorizationManagerRequestMatcherRegistry,HttpSecurity.RequestMatcherConfigurer,WebSecurity.IgnoredRequestConfigurer
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionMaps any request.protected abstract CchainRequestMatchers(List<RequestMatcher> requestMatchers) Subclasses should implement this method for returning the object that is chained to the creation of theRequestMatcherinstances.dispatcherTypeMatchers(jakarta.servlet.DispatcherType... dispatcherTypes) dispatcherTypeMatchers(org.springframework.http.HttpMethod method, jakarta.servlet.DispatcherType... dispatcherTypes) Maps aListofDispatcherTypeRequestMatcherinstances.protected final org.springframework.context.ApplicationContextGets theApplicationContextrequestMatchers(String... patterns) Match when the request URI matches one ofpatterns.requestMatchers(org.springframework.http.HttpMethod method) Match when theHttpMethodismethodrequestMatchers(org.springframework.http.HttpMethod method, String... patterns) Match when theHttpMethodismethodand when the request URI matches one ofpatterns.requestMatchers(RequestMatcher... requestMatchers) Associates a list ofRequestMatcherinstances with theAbstractRequestMatcherRegistryprotected final voidsetApplicationContext(org.springframework.context.ApplicationContext context)
-
Constructor Details
-
AbstractRequestMatcherRegistry
public AbstractRequestMatcherRegistry()
-
-
Method Details
-
setApplicationContext
protected final void setApplicationContext(org.springframework.context.ApplicationContext context) -
getApplicationContext
protected final org.springframework.context.ApplicationContext getApplicationContext()Gets theApplicationContext- Returns:
- the
ApplicationContext
-
anyRequest
Maps any request.- Returns:
- the object that is chained after creating the
RequestMatcher
-
dispatcherTypeMatchers
public C dispatcherTypeMatchers(@Nullable org.springframework.http.HttpMethod method, jakarta.servlet.DispatcherType... dispatcherTypes) Maps aListofDispatcherTypeRequestMatcherinstances.- Parameters:
method- theHttpMethodto use ornullfor anyHttpMethod.dispatcherTypes- the dispatcher types to match against- Returns:
- the object that is chained after creating the
RequestMatcher
-
dispatcherTypeMatchers
- Parameters:
dispatcherTypes- the dispatcher types to match against- Returns:
- the object that is chained after creating the
RequestMatcher
-
requestMatchers
Associates a list ofRequestMatcherinstances with theAbstractRequestMatcherRegistry- Parameters:
requestMatchers- theRequestMatcherinstances- Returns:
- the object that is chained after creating the
RequestMatcher
-
requestMatchers
Match when the
HttpMethodismethodand when the request URI matches one ofpatterns. SeePathPatternfor matching rules.If a specific
RequestMatchermust be specified, userequestMatchers(RequestMatcher...)instead- Parameters:
method- theHttpMethodto use ornullfor anyHttpMethod.patterns- the patterns to match on- Returns:
- the object that is chained after creating the
RequestMatcher. - Since:
- 5.8
-
requestMatchers
Match when the request URI matches one of
patterns. SeePathPatternfor matching rules.If a specific
RequestMatchermust be specified, userequestMatchers(RequestMatcher...)instead- Parameters:
patterns- the patterns to match on- Returns:
- the object that is chained after creating the
RequestMatcher. - Since:
- 5.8
-
requestMatchers
Match when the
HttpMethodismethodIf a specific
RequestMatchermust be specified, userequestMatchers(RequestMatcher...)instead- Parameters:
method- theHttpMethodto use ornullfor anyHttpMethod.- Returns:
- the object that is chained after creating the
RequestMatcher. - Since:
- 5.8
-
chainRequestMatchers
Subclasses should implement this method for returning the object that is chained to the creation of theRequestMatcherinstances.- Parameters:
requestMatchers- theRequestMatcherinstances that were created- Returns:
- the chained Object for the subclass which allows association of something
else to the
RequestMatcher
-