类 RequestMappingInfo
- java.lang.Object
- org.springframework.web.servlet.mvc.method.RequestMappingInfo
- 所有已实现的接口:
RequestCondition<RequestMappingInfo>
public final class RequestMappingInfo extends Object implements RequestCondition<RequestMappingInfo>
ARequestConditionthat consists of the following other conditions:PatternsRequestConditionRequestMethodsRequestConditionParamsRequestConditionHeadersRequestConditionConsumesRequestConditionProducesRequestConditionRequestCondition(optional, custom request condition)
- 从以下版本开始:
- 3.1
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interfaceRequestMappingInfo.BuilderDefines a builder for creating a RequestMappingInfo.static classRequestMappingInfo.BuilderConfigurationContainer for configuration options used for request mapping purposes.
构造器概要
构造器 构造器 说明 RequestMappingInfo(String name, PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom)RequestMappingInfo(PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom)Creates a new instance with the given request conditions.RequestMappingInfo(RequestMappingInfo info, RequestCondition<?> customRequestCondition)Re-create a RequestMappingInfo with the given custom request condition.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 RequestMappingInfocombine(RequestMappingInfo other)Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.intcompareTo(RequestMappingInfo other, HttpServletRequest request)Compares "this" info (i.e. the current instance) with another info in the context of a request.booleanequals(Object other)ConsumesRequestConditiongetConsumesCondition()Return the "consumes" condition of thisRequestMappingInfo; or instance with 0 consumes expressions (nevernull).RequestCondition<?>getCustomCondition()Return the "custom" condition of thisRequestMappingInfo, ornull.HeadersRequestConditiongetHeadersCondition()Return the "headers" condition of thisRequestMappingInfo; or instance with 0 header expressions (nevernull).RequestMappingInfogetMatchingCondition(HttpServletRequest 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.RequestMethodsRequestConditiongetMethodsCondition()Return the HTTP request methods of thisRequestMappingInfo; or instance with 0 request methods (nevernull).StringgetName()Return the name for this mapping, ornull.ParamsRequestConditiongetParamsCondition()Return the "parameters" condition of thisRequestMappingInfo; or instance with 0 parameter expressions (nevernull).PatternsRequestConditiongetPatternsCondition()Return the URL patterns of thisRequestMappingInfo; or instance with 0 patterns (nevernull).ProducesRequestConditiongetProducesCondition()Return the "produces" condition of thisRequestMappingInfo; or instance with 0 produces expressions (nevernull).inthashCode()static RequestMappingInfo.Builderpaths(String... paths)Create a newRequestMappingInfo.Builderwith the given paths.StringtoString()
构造器详细资料
RequestMappingInfo
public RequestMappingInfo(String name, PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom)
RequestMappingInfo
public RequestMappingInfo(PatternsRequestCondition patterns, RequestMethodsRequestCondition methods, ParamsRequestCondition params, HeadersRequestCondition headers, ConsumesRequestCondition consumes, ProducesRequestCondition produces, RequestCondition<?> custom)
Creates a new instance with the given request conditions.
RequestMappingInfo
public RequestMappingInfo(RequestMappingInfo info, RequestCondition<?> customRequestCondition)
Re-create a RequestMappingInfo with the given custom request condition.
方法详细资料
getPatternsCondition
public PatternsRequestCondition getPatternsCondition()
Return the URL patterns of thisRequestMappingInfo; or instance with 0 patterns (nevernull).
getMethodsCondition
public RequestMethodsRequestCondition getMethodsCondition()
Return the HTTP request methods of thisRequestMappingInfo; or instance with 0 request methods (nevernull).
getParamsCondition
public ParamsRequestCondition getParamsCondition()
Return the "parameters" condition of thisRequestMappingInfo; or instance with 0 parameter expressions (nevernull).
getHeadersCondition
public HeadersRequestCondition getHeadersCondition()
Return the "headers" condition of thisRequestMappingInfo; or instance with 0 header expressions (nevernull).
getConsumesCondition
public ConsumesRequestCondition getConsumesCondition()
Return the "consumes" condition of thisRequestMappingInfo; or instance with 0 consumes expressions (nevernull).
getProducesCondition
public ProducesRequestCondition getProducesCondition()
Return the "produces" condition of thisRequestMappingInfo; or instance with 0 produces expressions (nevernull).
getCustomCondition
public RequestCondition<?> getCustomCondition()
Return the "custom" condition of thisRequestMappingInfo, ornull.
combine
public RequestMappingInfo combine(RequestMappingInfo other)
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
getMatchingCondition
public RequestMappingInfo getMatchingCondition(HttpServletRequest 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.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>- 返回:
- a new instance in case all conditions match; or
nullotherwise
compareTo
public int compareTo(RequestMappingInfo other, HttpServletRequest request)
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(HttpServletRequest)to ensure they have conditions with content relevant to current request.- 指定者:
compareTo在接口中RequestCondition<RequestMappingInfo>
paths
public static RequestMappingInfo.Builder paths(String... paths)
Create a newRequestMappingInfo.Builderwith the given paths.- 参数:
paths- the paths to use- 从以下版本开始:
- 4.2