类 InterceptorRegistration
- java.lang.Object
- org.springframework.web.servlet.config.annotation.InterceptorRegistration
public class InterceptorRegistration extends Object
Assists with the creation of aMappedInterceptor
.- 从以下版本开始:
- 3.1
- 作者:
- Rossen Stoyanchev, Keith Donald
构造器概要
构造器 构造器 说明 InterceptorRegistration(HandlerInterceptor interceptor)
Create anInterceptorRegistration
instance.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 InterceptorRegistration
addPathPatterns(String... patterns)
Add URL patterns to which the registered interceptor should apply to.InterceptorRegistration
addPathPatterns(List<String> patterns)
List-based variant ofaddPathPatterns(String...)
.InterceptorRegistration
excludePathPatterns(String... patterns)
Add URL patterns to which the registered interceptor should not apply to.InterceptorRegistration
excludePathPatterns(List<String> patterns)
List-based variant ofexcludePathPatterns(String...)
.protected Object
getInterceptor()
Build the underlying interceptor.protected int
getOrder()
Return the order position to be used.InterceptorRegistration
order(int order)
Specify an order position to be used.InterceptorRegistration
pathMatcher(PathMatcher pathMatcher)
A PathMatcher implementation to use with this interceptor.
构造器详细资料
InterceptorRegistration
public InterceptorRegistration(HandlerInterceptor interceptor)
Create anInterceptorRegistration
instance.
方法详细资料
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...)
.- 从以下版本开始:
- 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...)
.- 从以下版本开始:
- 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.- 从以下版本开始:
- 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
.