org.springframework.web.servlet.config.annotation

## Class InterceptorRegistration

- java.lang.Object
- - org.springframework.web.servlet.config.annotation.InterceptorRegistration

-     public class InterceptorRegistration
      extends Object

  Assists with the creation of a `MappedInterceptor`.
  Since:
    3.1
  Author:
    Rossen Stoyanchev, Keith Donald

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `InterceptorRegistration(HandlerInterceptor interceptor)` Creates an `InterceptorRegistration` instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `InterceptorRegistration` | `addPathPatterns(String... patterns)` Add URL patterns to which the registered interceptor should apply to.
    `InterceptorRegistration` | `excludePathPatterns(String... patterns)` Add URL patterns to which the registered interceptor should not apply to.
    `protected Object` | `getInterceptor()` Returns the underlying interceptor.
    `InterceptorRegistration` | `pathMatcher(PathMatcher pathMatcher)` A PathMatcher implementation to use with this interceptor.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### InterceptorRegistration

          public InterceptorRegistration(HandlerInterceptor interceptor)

      Creates an `InterceptorRegistration` instance.

  - ### Method Detail

    - #### addPathPatterns

          public InterceptorRegistration addPathPatterns(String... patterns)

      Add URL patterns to which the registered interceptor should apply to.

    - #### excludePathPatterns

          public InterceptorRegistration excludePathPatterns(String... patterns)

      Add URL patterns to which the registered interceptor should not apply to.

    - #### 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.

    - #### getInterceptor

          protected Object getInterceptor()

      Returns the underlying interceptor. If URL patterns are provided the returned type is `MappedInterceptor`; otherwise `HandlerInterceptor`.