类 RequestMappingInfo
- java.lang.Object
- org.springframework.web.servlet.mvc.method.RequestMappingInfo
- 所有已实现的接口:
RequestCondition<RequestMappingInfo>
public final class RequestMappingInfo extends Object implements RequestCondition<RequestMappingInfo>
ARequestCondition
that consists of the following other conditions:PatternsRequestCondition
RequestMethodsRequestCondition
ParamsRequestCondition
HeadersRequestCondition
ConsumesRequestCondition
ProducesRequestCondition
RequestCondition
(optional, custom request condition)
- 从以下版本开始:
- 3.1
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
嵌套类概要
嵌套类 修饰符和类型 类 说明 static interface
RequestMappingInfo.Builder
Defines a builder for creating a RequestMappingInfo.static class
RequestMappingInfo.BuilderConfiguration
Container 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.
方法概要
所有方法 静态方法 实例方法 具体方法 修饰符和类型 方法 说明 RequestMappingInfo
combine(RequestMappingInfo other)
Combine "this" request mapping info (i.e. the current instance) with another request mapping info instance.int
compareTo(RequestMappingInfo other, HttpServletRequest request)
Compares "this" info (i.e. the current instance) with another info in the context of a request.boolean
equals(Object other)
ConsumesRequestCondition
getConsumesCondition()
Return the "consumes" condition of thisRequestMappingInfo
; or instance with 0 consumes expressions (nevernull
).RequestCondition<?>
getCustomCondition()
Return the "custom" condition of thisRequestMappingInfo
, ornull
.HeadersRequestCondition
getHeadersCondition()
Return the "headers" condition of thisRequestMappingInfo
; or instance with 0 header expressions (nevernull
).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.RequestMethodsRequestCondition
getMethodsCondition()
Return the HTTP request methods of thisRequestMappingInfo
; or instance with 0 request methods (nevernull
).String
getName()
Return the name for this mapping, ornull
.ParamsRequestCondition
getParamsCondition()
Return the "parameters" condition of thisRequestMappingInfo
; or instance with 0 parameter expressions (nevernull
).PatternsRequestCondition
getPatternsCondition()
Return the URL patterns of thisRequestMappingInfo
; or instance with 0 patterns (nevernull
).ProducesRequestCondition
getProducesCondition()
Return the "produces" condition of thisRequestMappingInfo
; or instance with 0 produces expressions (nevernull
).int
hashCode()
static RequestMappingInfo.Builder
paths(String... paths)
Create a newRequestMappingInfo.Builder
with the given paths.String
toString()
构造器详细资料
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
null
otherwise
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.Builder
with the given paths.- 参数:
paths
- the paths to use- 从以下版本开始:
- 4.2