类 RequestMappingInfo
java.lang.Object
cn.taketoday.web.handler.method.RequestMappingInfo
- 所有已实现的接口:
RequestCondition<RequestMappingInfo>
public final class RequestMappingInfo
extends Object
implements RequestCondition<RequestMappingInfo>
Request mapping information. A composite for the following conditions:
PathPatternsRequestConditionwith parsedPathPatternsRequestMethodsRequestConditionParamsRequestConditionHeadersRequestConditionConsumesRequestConditionProducesRequestConditionRequestCondition(optional, custom request condition)
- 从以下版本开始:
- 4.0 2022/4/1 21:41
- 作者:
- Arjen Poutsma, Rossen Stoyanchev, Harry Yang
-
嵌套类概要
嵌套类修饰符和类型类说明static interfaceDefines a builder for creating a RequestMappingInfo.static classContainer for configuration options used for request mapping purposes.private static classprivate static class -
字段概要
字段修饰符和类型字段说明private final booleanprivate final ConsumesRequestConditionprivate final RequestConditionHolderprivate static final ConsumesRequestConditionprivate static final RequestConditionHolderprivate static final HeadersRequestConditionprivate static final ParamsRequestConditionprivate static final PathPatternsRequestConditionprivate static final ProducesRequestConditionprivate static final RequestMethodsRequestConditionprivate final intprivate final HeadersRequestConditionprivate final RequestMethodsRequestConditionprivate final Stringprivate final RequestMappingInfo.BuilderConfigurationprivate final ParamsRequestConditionprivate final PathPatternsRequestConditionprivate final ProducesRequestCondition -
构造器概要
构造器构造器说明RequestMappingInfo(String name, PathPatternsRequestCondition pathPatternsCondition, RequestMethodsRequestCondition methodsCondition, ParamsRequestCondition paramsCondition, HeadersRequestCondition headersCondition, ConsumesRequestCondition consumesCondition, ProducesRequestCondition producesCondition, RequestConditionHolder customCondition, RequestMappingInfo.BuilderConfiguration options, boolean combine) -
方法概要
修饰符和类型方法说明addCustomCondition(RequestCondition<?> customCondition) Create a new instance based on the current one, also adding the given custom condition.private static intcalculateHashCode(PathPatternsRequestCondition pathPatterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestConditionHolder custom) combine(RequestMappingInfo other) Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.private StringcombineNames(RequestMappingInfo other) intcompareTo(RequestMappingInfo other, RequestContext request) Compares "this" info (i.e. the current instance) with another info in the context of a request.booleanReturn the "consumes" condition of thisRequestMappingInfo; or instance with 0 consumes expressions (nevernull).Return the "custom" condition of thisRequestMappingInfo, ornull.Return the mapping paths that are not patterns.Return the "headers" condition of thisRequestMappingInfo; or instance with 0 header expressions (nevernull).getMatchingCondition(RequestContext request) Checks if all conditions in this request mapping info match the provided request and returns a potentially new request mapping info with conditions tailored to the current request.Return the HTTP request methods of thisRequestMappingInfo; or instance with 0 request methods (nevernull).getName()Return the name for this mapping, ornull.Return the "parameters" condition of thisRequestMappingInfo; or instance with 0 parameter expressions (nevernull).Return the patterns conditionReturn the patterns for theactivepatterns condition as Strings.Return the "produces" condition of thisRequestMappingInfo; or instance with 0 produces expressions (nevernull).inthashCode()booleanmutate()Return a builder to create a new RequestMappingInfo by modifying this one.static RequestMappingInfo.BuilderCreate a newRequestMappingInfo.Builderwith the given paths.toString()
-
字段详细资料
-
EMPTY_PARAMS
-
EMPTY_HEADERS
-
EMPTY_CUSTOM
-
EMPTY_CONSUMES
-
EMPTY_PRODUCES
-
EMPTY_PATH_PATTERNS
-
EMPTY_REQUEST_METHODS
-
name
-
methodsCondition
-
pathPatternsCondition
-
paramsCondition
-
headersCondition
-
consumesCondition
-
producesCondition
-
customConditionHolder
-
hashCode
private final int hashCode -
options
-
combine
private final boolean combine
-
-
构造器详细资料
-
RequestMappingInfo
RequestMappingInfo(@Nullable String name, PathPatternsRequestCondition pathPatternsCondition, RequestMethodsRequestCondition methodsCondition, ParamsRequestCondition paramsCondition, HeadersRequestCondition headersCondition, ConsumesRequestCondition consumesCondition, ProducesRequestCondition producesCondition, RequestConditionHolder customCondition, RequestMappingInfo.BuilderConfiguration options, boolean combine)
-
-
方法详细资料
-
getName
Return the name for this mapping, ornull. -
getPathPatternsCondition
Return the patterns condition -
getDirectPaths
Return the mapping paths that are not patterns. -
getPatternValues
Return the patterns for theactivepatterns condition as Strings. -
getMethodsCondition
Return the HTTP request methods of thisRequestMappingInfo; or instance with 0 request methods (nevernull). -
getParamsCondition
Return the "parameters" condition of thisRequestMappingInfo; or instance with 0 parameter expressions (nevernull). -
getHeadersCondition
Return the "headers" condition of thisRequestMappingInfo; or instance with 0 header expressions (nevernull). -
getConsumesCondition
Return the "consumes" condition of thisRequestMappingInfo; or instance with 0 consumes expressions (nevernull). -
getProducesCondition
Return the "produces" condition of thisRequestMappingInfo; or instance with 0 produces expressions (nevernull). -
getCustomCondition
Return the "custom" condition of thisRequestMappingInfo, ornull. -
isCombine
public boolean isCombine() -
addCustomCondition
Create a new instance based on the current one, also adding the given custom condition.- 参数:
customCondition- the custom condition to add
-
combine
Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.Example: combine type- and method-level request mappings.
- 指定者:
combine在接口中RequestCondition<RequestMappingInfo>- 参数:
other- the condition to combine with.- 返回:
- a new request mapping info instance; never
null
-
combineNames
-
getMatchingCondition
Checks if all conditions in this request mapping info match the provided request and returns a potentially new request mapping info with conditions tailored to the current request.For example the returned instance may contain the subset of URL patterns that match to the current request, sorted with best matching patterns on top.
- 指定者:
getMatchingCondition在接口中RequestCondition<RequestMappingInfo>- 参数:
request- the current request context- 返回:
- a new instance in case of a match; or
nullotherwise
-
compareTo
Compares "this" info (i.e. the current instance) with another info in the context of a request.Note: It is assumed both instances have been obtained via
getMatchingCondition(RequestContext)to ensure they have conditions with content relevant to current request.- 指定者:
compareTo在接口中RequestCondition<RequestMappingInfo>request- the current request context
-
equals
-
hashCode
public int hashCode() -
calculateHashCode
private static int calculateHashCode(PathPatternsRequestCondition pathPatterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestConditionHolder custom) -
toString
-
mutate
Return a builder to create a new RequestMappingInfo by modifying this one.- 返回:
- a builder to create a new, modified instance
-
paths
Create a newRequestMappingInfo.Builderwith the given paths.- 参数:
paths- the paths to use
-