接口 RequestCondition<T>
- 类型参数:
T- the type of objects that this RequestCondition can be combined with and compared to
- 所有已知实现类:
AbstractRequestCondition,CompositeRequestCondition,ConsumesRequestCondition,HeadersRequestCondition,ParamsRequestCondition,PathPatternsRequestCondition,ProducesRequestCondition,RequestConditionHolder,RequestMappingInfo,RequestMethodsRequestCondition
public interface RequestCondition<T>
Contract for request mapping conditions.
Request conditions can be combined via combine(Object), matched to
a request via getMatchingCondition(RequestContext), and compared
to each other via compareTo(Object, RequestContext) to determine
which is a closer match for a given request.
- 从以下版本开始:
- 4.0
- 作者:
- Rossen Stoyanchev, Arjen Poutsma
-
方法概要
修饰符和类型方法说明Combine this condition with another such as conditions from a type-level and method-level@RequestMappingannotation.intcompareTo(T other, RequestContext request) Compare this condition to another condition in the context of a specific request.getMatchingCondition(RequestContext request) Check if the condition matches the request returning a potentially new instance created for the current request.
-
方法详细资料
-
combine
Combine this condition with another such as conditions from a type-level and method-level@RequestMappingannotation.- 参数:
other- the condition to combine with.- 返回:
- a request condition instance that is the result of combining the two condition instances.
-
getMatchingCondition
Check if the condition matches the request returning a potentially new instance created for the current request. For example a condition with multiple URL patterns may return a new instance only with those patterns that match the request.For CORS pre-flight requests, conditions should match to the would-be, actual request (e.g. URL pattern, query parameters, and the HTTP method from the "Access-Control-Request-Method" header). If a condition cannot be matched to a pre-flight request it should return an instance with empty content thus not causing a failure to match.
- 参数:
request- the current request context- 返回:
- a condition instance in case of a match or
nullotherwise.
-
compareTo
Compare this condition to another condition in the context of a specific request. This method assumes both instances have been obtained viagetMatchingCondition(RequestContext)to ensure they have content relevant to current request only.- 参数:
request- the current request context
-