Skip to content

Commit dde8f44

Browse files
committed
Polish MappedInterceptor
1 parent f9f7a7c commit dde8f44

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

spring-webmvc/src/main/java/org/springframework/web/servlet/handler/MappedInterceptor.java

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,18 @@
4040
* Wraps a {@link HandlerInterceptor} and uses URL patterns to determine whether
4141
* it applies to a given request.
4242
*
43-
* <p>Pattern matching can be done with {@link PathMatcher} or with parsed
43+
* <p>Pattern matching can be done with a {@link PathMatcher} or with a parsed
4444
* {@link PathPattern}. The syntax is largely the same with the latter being more
4545
* tailored for web usage and more efficient. The choice is driven by the
46-
* presence of a {@link UrlPathHelper#resolveAndCacheLookupPath resolved}
47-
* {@code String} lookupPath or a {@link ServletRequestPathUtils#parseAndCache
48-
* parsed} {@code RequestPath} which in turn depends on the
49-
* {@link HandlerMapping} that matched the current request.
46+
* presence of a {@linkplain UrlPathHelper#resolveAndCacheLookupPath resolved}
47+
* {@code String} lookupPath or a {@linkplain ServletRequestPathUtils#parseAndCache
48+
* parsed} {@code RequestPath} which in turn depends on the {@link HandlerMapping}
49+
* that matched the current request.
5050
*
5151
* <p>{@code MappedInterceptor} is supported by subclasses of
5252
* {@link org.springframework.web.servlet.handler.AbstractHandlerMethodMapping
53-
* AbstractHandlerMethodMapping} which detect beans of type
54-
* {@code MappedInterceptor} and also check if interceptors directly registered
55-
* with it are of this type.
53+
* AbstractHandlerMethodMapping} which detect beans of type {@code MappedInterceptor}
54+
* and also check if interceptors directly registered with it are of this type.
5655
*
5756
* @author Keith Donald
5857
* @author Rossen Stoyanchev
@@ -187,15 +186,15 @@ public HandlerInterceptor getInterceptor() {
187186
* <p>By default this is {@link AntPathMatcher}.
188187
* <p><strong>Note:</strong> Setting {@code PathMatcher} enforces use of
189188
* String pattern matching even when a
190-
* {@link ServletRequestPathUtils#parseAndCache parsed} {@code RequestPath}
189+
* {@linkplain ServletRequestPathUtils#parseAndCache parsed} {@code RequestPath}
191190
* is available.
192191
*/
193192
public void setPathMatcher(PathMatcher pathMatcher) {
194193
this.pathMatcher = pathMatcher;
195194
}
196195

197196
/**
198-
* The {@link #setPathMatcher(PathMatcher) configured} PathMatcher.
197+
* Get the {@linkplain #setPathMatcher(PathMatcher) configured} PathMatcher.
199198
*/
200199
public PathMatcher getPathMatcher() {
201200
return this.pathMatcher;
@@ -234,13 +233,13 @@ public boolean matches(HttpServletRequest request) {
234233
}
235234

236235
/**
237-
* Determine a match for the given lookup path.
236+
* Determine if there is a match for the given lookup path.
238237
* @param lookupPath the current request path
239238
* @param pathMatcher a path matcher for path pattern matching
240239
* @return {@code true} if the interceptor applies to the given request path
241240
* @deprecated as of 5.3 in favor of {@link #matches(HttpServletRequest)}
242241
*/
243-
@Deprecated
242+
@Deprecated(since = "5.3")
244243
public boolean matches(String lookupPath, PathMatcher pathMatcher) {
245244
pathMatcher = (this.pathMatcher != defaultPathMatcher ? this.pathMatcher : pathMatcher);
246245
if (!ObjectUtils.isEmpty(this.excludePatterns)) {

0 commit comments

Comments
 (0)