org.springframework.web.servlet.config.annotation
Class InterceptorRegistration
java.lang.Object
org.springframework.web.servlet.config.annotation.InterceptorRegistration
public class InterceptorRegistration
- extends java.lang.Object
Encapsulates a HandlerInterceptor
and an optional list of URL patterns.
Results in the creation of a MappedInterceptor
if URL patterns are provided.
- Since:
- 3.1
- Author:
- Rossen Stoyanchev, Keith Donald
Method Summary |
void |
addPathPatterns(java.lang.String... pathPatterns)
Adds one or more URL patterns to which the registered interceptor should apply to. |
protected java.lang.Object |
getInterceptor()
Returns the underlying interceptor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
interceptor
private final HandlerInterceptor interceptor
pathPatterns
private final java.util.List<java.lang.String> pathPatterns
InterceptorRegistration
public InterceptorRegistration(HandlerInterceptor interceptor)
- Creates an
InterceptorRegistration
instance.
addPathPatterns
public void addPathPatterns(java.lang.String... pathPatterns)
- Adds one or more URL patterns to which the registered interceptor should apply to.
If no URL patterns are provided, the interceptor applies to all paths.
getInterceptor
protected java.lang.Object getInterceptor()
- Returns the underlying interceptor. If URL patterns are provided the returned type is
MappedInterceptor
; otherwise HandlerInterceptor
.