类 HeadersRequestCondition
java.lang.Object
cn.taketoday.web.handler.condition.AbstractRequestCondition<HeadersRequestCondition>
cn.taketoday.web.handler.condition.HeadersRequestCondition
- 所有已实现的接口:
RequestCondition<HeadersRequestCondition>
public final class HeadersRequestCondition
extends AbstractRequestCondition<HeadersRequestCondition>
A logical conjunction (
' && ') request condition that matches a request against
a set of header expressions with syntax defined in RequestMapping.headers().
Expressions passed to the constructor with header names 'Accept' or
'Content-Type' are ignored. See ConsumesRequestCondition and
ProducesRequestCondition for those.
- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
-
嵌套类概要
嵌套类修饰符和类型类说明(专用程序包) static classParses and matches a single header expression to a request. -
字段概要
字段修饰符和类型字段说明private final Set<HeadersRequestCondition.HeaderExpression>private static final HeadersRequestCondition -
构造器概要
构造器限定符构造器说明HeadersRequestCondition(String... headers) Create a new instance from the given header expressions.private -
方法概要
修饰符和类型方法说明combine(HeadersRequestCondition other) Returns a new instance with the union of the header expressions from "this" and the "other" instance.intcompareTo(HeadersRequestCondition other, RequestContext request) Compare to another condition based on header expressions.Return the discrete items a request condition is composed of.Return the contained request header expressions.getMatchingCondition(RequestContext request) Returns "this" instance if the request matches all expressions; ornullotherwise.protected StringThe notation to use when printing discrete items of content.private longgetValueMatchCount(Set<HeadersRequestCondition.HeaderExpression> expressions) private static Set<HeadersRequestCondition.HeaderExpression>parseExpressions(String... headers) 从类继承的方法 cn.taketoday.web.handler.condition.AbstractRequestCondition
equals, hashCode, isEmpty, toString
-
字段详细资料
-
PRE_FLIGHT_MATCH
-
expressions
-
-
构造器详细资料
-
HeadersRequestCondition
Create a new instance from the given header expressions. Expressions with header names 'Accept' or 'Content-Type' are ignored. SeeConsumesRequestConditionandProducesRequestConditionfor those.- 参数:
headers- media type expressions with syntax defined inRequestMapping.headers(); if 0, the condition will match to every request
-
HeadersRequestCondition
-
-
方法详细资料
-
parseExpressions
-
getExpressions
Return the contained request header expressions. -
getContent
从类复制的说明:AbstractRequestConditionReturn the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- 指定者:
getContent在类中AbstractRequestCondition<HeadersRequestCondition>- 返回:
- a collection of objects (never
null)
-
getToStringInfix
从类复制的说明:AbstractRequestConditionThe notation to use when printing discrete items of content.For example
" || "for URL patterns or" && "for param expressions. -
combine
Returns a new instance with the union of the header expressions from "this" and the "other" instance.- 参数:
other- the condition to combine with.- 返回:
- a request condition instance that is the result of combining the two condition instances.
-
getMatchingCondition
Returns "this" instance if the request matches all expressions; ornullotherwise.- 参数:
request- the current request context- 返回:
- a condition instance in case of a match or
nullotherwise.
-
compareTo
Compare to another condition based on header expressions. A condition is considered to be a more specific match, if it has:- A greater number of expressions.
- A greater number of non-negated expressions with a concrete value.
It is assumed that both instances have been obtained via
getMatchingCondition(RequestContext)and each instance contains the matching header expression only or is otherwise empty.request- the current request context
-
getValueMatchCount
-