Class ApplicationContextRequestMatcher<C>
- java.lang.Object
- org.springframework.boot.security.servlet.ApplicationContextRequestMatcher<C>
- Type Parameters:
C
- the type of the context that the match method actually needs to use. Can be anApplicationContext
or a class of anexisting bean
.
- All Implemented Interfaces:
org.springframework.security.web.util.matcher.RequestMatcher
public abstract class ApplicationContextRequestMatcher<C> extends Object implements org.springframework.security.web.util.matcher.RequestMatcher
ApplicationContext
backedRequestMatcher
. Can work directly with theApplicationContext
, obtain an existing bean orcreate a new bean
that is autowired in the usual way.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description ApplicationContextRequestMatcher(Class<? extends C> contextClass)
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
initialized(Supplier<C> context)
Called once the context has been initialized.boolean
matches(javax.servlet.http.HttpServletRequest request)
protected abstract boolean
matches(javax.servlet.http.HttpServletRequest request, Supplier<C> context)
Decides whether the rule implemented by the strategy matches the supplied request.
Constructor Detail
ApplicationContextRequestMatcher
public ApplicationContextRequestMatcher(Class<? extends C> contextClass)
Method Detail
matches
public final boolean matches(javax.servlet.http.HttpServletRequest request)
- Specified by:
matches
in interfaceorg.springframework.security.web.util.matcher.RequestMatcher
matches
protected abstract boolean matches(javax.servlet.http.HttpServletRequest request, Supplier<C> context)
Decides whether the rule implemented by the strategy matches the supplied request.- Parameters:
request
- the source requestcontext
- a supplier for the initialized context (may throw an exception)- Returns:
- if the request matches
initialized
protected void initialized(Supplier<C> context)
Called once the context has been initialized.- Parameters:
context
- a supplier for the initialized context (may throw an exception)