Top Description Fields Constructors Methods
org.springframework.web.servlet.config.annotation

public Class InterceptorRegistry

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Comparator, .List, org.springframework.core.OrderComparator, .Ordered, org.springframework.web.context.request.WebRequestInterceptor, org.springframework.web.servlet.HandlerInterceptor, org.springframework.web.servlet.handler.WebRequestHandlerInterceptorAdapter

Helps with configuring a list of mapped interceptors.
Authors
Rossen Stoyanchev, Keith Donald
Since
3.1

Field Summary

Modifier and TypeField and Description
private static final Comparator<Object>
private final List<InterceptorRegistration>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public InterceptorRegistration

Returns:

an InterceptorRegistration that allows you optionally configure the registered interceptor further for example adding URL patterns it should apply to.
addInterceptor
(HandlerInterceptor
the interceptor to add
interceptor
)

Adds the provided HandlerInterceptor.

public InterceptorRegistration

Returns:

an InterceptorRegistration that allows you optionally configure the registered interceptor further for example adding URL patterns it should apply to.
addWebRequestInterceptor
(WebRequestInterceptor
the interceptor to add
interceptor
)

Adds the provided WebRequestInterceptor.

protected List<Object>
getInterceptors()

Return all registered interceptors.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INTERCEPTOR_ORDER_COMPARATORback to summary
private static final Comparator<Object> INTERCEPTOR_ORDER_COMPARATOR
registrationsback to summary
private final List<InterceptorRegistration> registrations

Constructor Detail

InterceptorRegistryback to summary
public InterceptorRegistry()

Method Detail

addInterceptorback to summary
public InterceptorRegistration addInterceptor(HandlerInterceptor interceptor)

Adds the provided HandlerInterceptor.

Parameters
interceptor:HandlerInterceptor

the interceptor to add

Returns:InterceptorRegistration

an InterceptorRegistration that allows you optionally configure the registered interceptor further for example adding URL patterns it should apply to.

addWebRequestInterceptorback to summary
public InterceptorRegistration addWebRequestInterceptor(WebRequestInterceptor interceptor)

Adds the provided WebRequestInterceptor.

Parameters
interceptor:WebRequestInterceptor

the interceptor to add

Returns:InterceptorRegistration

an InterceptorRegistration that allows you optionally configure the registered interceptor further for example adding URL patterns it should apply to.

getInterceptorsback to summary
protected List<Object> getInterceptors()

Return all registered interceptors.