类 MappedInterceptor
java.lang.Object
cn.taketoday.web.handler.MappedInterceptor
- 所有已实现的接口:
HandlerInterceptor
Wraps a
HandlerInterceptor and uses URL patterns to determine whether
it applies to a given request.
Pattern matching can be done with PathMatcher or with parsed
PathPattern. The syntax is largely the same with the latter being more
tailored for web usage and more efficient.
- 从以下版本开始:
- 4.0 2022/4/18 15:36
- 作者:
- Keith Donald, Rossen Stoyanchev, Brian Clozel, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明private static final classContains both the parsedPathPatternand the raw String pattern, and uses the former when the cached path isPathContaineror the latter otherwise. -
字段概要
字段修饰符和类型字段说明private static final cn.taketoday.core.PathMatcherprivate final MappedInterceptor.CompiledPattern[]private final MappedInterceptor.CompiledPattern[]private final HandlerInterceptorprivate cn.taketoday.core.PathMatcher从接口继承的字段 cn.taketoday.web.HandlerInterceptor
EMPTY_ARRAY, NONE_RETURN_VALUE -
构造器概要
构造器构造器说明MappedInterceptor(String[] includePatterns, HandlerInterceptor interceptor) Variant ofMappedInterceptor(String[], String[], HandlerInterceptor, PathPatternParser)with include patterns only.MappedInterceptor(String[] includePatterns, String[] excludePatterns, HandlerInterceptor interceptor) Variant ofMappedInterceptor(String[], String[], HandlerInterceptor, PathPatternParser)without a provided parser.MappedInterceptor(String[] includePatterns, String[] excludePatterns, HandlerInterceptor interceptor, PathPatternParser parser) Create an instance with the given include and exclude patterns along with the target interceptor for the mappings. -
方法概要
修饰符和类型方法说明voidafterProcess(RequestContext request, Object handler, Object result) After Handler processed.booleanbeforeProcess(RequestContext request, Object handler) Before Handler process.private booleandoMatch(MappedInterceptor.CompiledPattern adapter, PathContainer path) The targetHandlerInterceptorto invoke in case of a match.cn.taketoday.core.PathMatcherTheconfiguredPathMatcher.String[]Return the patterns this interceptor is mapped to.intercept(RequestContext request, InterceptorChain chain) handler's interceptor intercept entrancebooleanmatches(PathContainer lookupPath) Check whether this interceptor is mapped to the request.booleanmatches(RequestContext request) Check whether this interceptor is mapped to the request.voidsetPathMatcher(cn.taketoday.core.PathMatcher pathMatcher) Configure the PathMatcher to use to match URL paths with against include and exclude patterns.
-
字段详细资料
-
defaultPathMatcher
private static final cn.taketoday.core.PathMatcher defaultPathMatcher -
includePatterns
-
excludePatterns
-
interceptor
-
pathMatcher
private cn.taketoday.core.PathMatcher pathMatcher
-
-
构造器详细资料
-
MappedInterceptor
public MappedInterceptor(@Nullable String[] includePatterns, @Nullable String[] excludePatterns, HandlerInterceptor interceptor, @Nullable PathPatternParser parser) Create an instance with the given include and exclude patterns along with the target interceptor for the mappings.- 参数:
includePatterns- patterns to which requests must match, or null to match all pathsexcludePatterns- patterns to which requests must not matchinterceptor- the target interceptorparser- a parser to use to pre-parse patterns intoPathPattern; when not provided,PathPatternParser.defaultInstanceis used.
-
MappedInterceptor
Variant ofMappedInterceptor(String[], String[], HandlerInterceptor, PathPatternParser)with include patterns only. -
MappedInterceptor
public MappedInterceptor(@Nullable String[] includePatterns, @Nullable String[] excludePatterns, HandlerInterceptor interceptor) Variant ofMappedInterceptor(String[], String[], HandlerInterceptor, PathPatternParser)without a provided parser.
-
-
方法详细资料
-
setPathMatcher
public void setPathMatcher(cn.taketoday.core.PathMatcher pathMatcher) Configure the PathMatcher to use to match URL paths with against include and exclude patterns.This is an advanced property that should be used only when a customized
AntPathMatcheror a custom PathMatcher is required.By default this is
AntPathMatcher. -
getPathMatcher
public cn.taketoday.core.PathMatcher getPathMatcher()TheconfiguredPathMatcher. -
getPathPatterns
Return the patterns this interceptor is mapped to. -
getInterceptor
The targetHandlerInterceptorto invoke in case of a match. -
matches
Check whether this interceptor is mapped to the request.The request mapping path is expected to have been resolved externally. See also class-level Javadoc.
- 参数:
request- the request to match to- 返回:
trueif the interceptor should be applied to the request
-
matches
Check whether this interceptor is mapped to the request.The request mapping path is expected to have been resolved externally. See also class-level Javadoc.
- 参数:
lookupPath- the request path to match to- 返回:
trueif the interceptor should be applied to the request
-
doMatch
-
beforeProcess
从接口复制的说明:HandlerInterceptorBefore Handler process.- 指定者:
beforeProcess在接口中HandlerInterceptor- 参数:
request- Current request Contexthandler- Request handler ,HandlerMethod- 返回:
- If is it possible to execute the target handler
- 抛出:
Throwable- If any exception occurred- 另请参阅:
-
afterProcess
从接口复制的说明:HandlerInterceptorAfter Handler processed.- 指定者:
afterProcess在接口中HandlerInterceptor- 参数:
request- Current request Contexthandler- Request handler,HandlerMethodresult- Handler returned value- 抛出:
Throwable- If any exception occurred- 另请参阅:
-
intercept
从接口复制的说明:HandlerInterceptorhandler's interceptor intercept entrance- 指定者:
intercept在接口中HandlerInterceptor- 返回:
- return value is target handler's result
- 抛出:
Throwable- 另请参阅:
-