Class InterceptorRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.InterceptorRegistration
public class InterceptorRegistration extends Object
Assists with the creation of aMappedInterceptor.- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Keith Donald
Constructor Summary
Constructors Constructor Description InterceptorRegistration(HandlerInterceptor interceptor)Create anInterceptorRegistrationinstance.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InterceptorRegistrationaddPathPatterns(String... patterns)Add URL patterns to which the registered interceptor should apply to.InterceptorRegistrationaddPathPatterns(List<String> patterns)List-based variant ofaddPathPatterns(String...).InterceptorRegistrationexcludePathPatterns(String... patterns)Add URL patterns to which the registered interceptor should not apply to.InterceptorRegistrationexcludePathPatterns(List<String> patterns)List-based variant ofexcludePathPatterns(String...).protected ObjectgetInterceptor()Build the underlying interceptor.protected intgetOrder()Return the order position to be used.InterceptorRegistrationorder(int order)Specify an order position to be used.InterceptorRegistrationpathMatcher(PathMatcher pathMatcher)A PathMatcher implementation to use with this interceptor.
Constructor Detail
InterceptorRegistration
public InterceptorRegistration(HandlerInterceptor interceptor)
Create anInterceptorRegistrationinstance.
Method Detail
addPathPatterns
public InterceptorRegistration addPathPatterns(String... patterns)
Add URL patterns to which the registered interceptor should apply to.
addPathPatterns
public InterceptorRegistration addPathPatterns(List<String> patterns)
List-based variant ofaddPathPatterns(String...).- Since:
- 5.0.3
excludePathPatterns
public InterceptorRegistration excludePathPatterns(String... patterns)
Add URL patterns to which the registered interceptor should not apply to.
excludePathPatterns
public InterceptorRegistration excludePathPatterns(List<String> patterns)
List-based variant ofexcludePathPatterns(String...).- Since:
- 5.0.3
pathMatcher
public InterceptorRegistration pathMatcher(PathMatcher pathMatcher)
A PathMatcher implementation to use with this interceptor. This is an optional, advanced property required only if using custom PathMatcher implementations that support mapping metadata other than the Ant path patterns supported by default.
order
public InterceptorRegistration order(int order)
Specify an order position to be used. Default is 0.- Since:
- 4.3.23
getOrder
protected int getOrder()
Return the order position to be used.
getInterceptor
protected Object getInterceptor()
Build the underlying interceptor. If URL patterns are provided, the returned type isMappedInterceptor; otherwiseHandlerInterceptor.