类 ParamsRequestCondition
- java.lang.Object
- org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<ParamsRequestCondition>
- org.springframework.web.servlet.mvc.condition.ParamsRequestCondition
- 所有已实现的接口:
RequestCondition<ParamsRequestCondition>
public final class ParamsRequestCondition extends AbstractRequestCondition<ParamsRequestCondition>
A logical conjunction (' && ') request condition that matches a request against a set parameter expressions with syntax defined inRequestMapping.params()
.- 从以下版本开始:
- 3.1
- 作者:
- Arjen Poutsma, Rossen Stoyanchev
构造器概要
构造器 构造器 说明 ParamsRequestCondition(String... params)
Create a new instance from the given param expressions.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 ParamsRequestCondition
combine(ParamsRequestCondition other)
Returns a new instance with the union of the param expressions from "this" and the "other" instance.int
compareTo(ParamsRequestCondition other, HttpServletRequest request)
Returns: 0 if the two conditions have the same number of parameter expressions Less than 0 if "this" instance has more parameter expressions Greater than 0 if the "other" instance has more parameter expressionsprotected Collection<org.springframework.web.servlet.mvc.condition.ParamsRequestCondition.ParamExpression>
getContent()
Return the discrete items a request condition is composed of.Set<NameValueExpression<String>>
getExpressions()
Return the contained request parameter expressions.ParamsRequestCondition
getMatchingCondition(HttpServletRequest request)
Returns "this" instance if the request matches all param expressions; ornull
otherwise.protected String
getToStringInfix()
The notation to use when printing discrete items of content.从类继承的方法 org.springframework.web.servlet.mvc.condition.AbstractRequestCondition
equals, hashCode, isEmpty, toString
构造器详细资料
ParamsRequestCondition
public ParamsRequestCondition(String... params)
Create a new instance from the given param expressions.- 参数:
params
- expressions with syntax defined inRequestMapping.params()
; if 0, the condition will match to every request.
方法详细资料
getExpressions
public Set<NameValueExpression<String>> getExpressions()
Return the contained request parameter expressions.
getContent
protected Collection<org.springframework.web.servlet.mvc.condition.ParamsRequestCondition.ParamExpression> getContent()
从类复制的说明:AbstractRequestCondition
Return the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- 指定者:
getContent
在类中AbstractRequestCondition<ParamsRequestCondition>
- 返回:
- a collection of objects (never
null
)
getToStringInfix
protected String getToStringInfix()
从类复制的说明:AbstractRequestCondition
The notation to use when printing discrete items of content.For example
" || "
for URL patterns or" && "
for param expressions.
combine
public ParamsRequestCondition combine(ParamsRequestCondition other)
Returns a new instance with the union of the param 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
public ParamsRequestCondition getMatchingCondition(HttpServletRequest request)
Returns "this" instance if the request matches all param expressions; ornull
otherwise.- 返回:
- a condition instance in case of a match or
null
otherwise.
compareTo
public int compareTo(ParamsRequestCondition other, HttpServletRequest request)
Returns:- 0 if the two conditions have the same number of parameter expressions
- Less than 0 if "this" instance has more parameter expressions
- Greater than 0 if the "other" instance has more parameter expressions
It is assumed that both instances have been obtained via
getMatchingCondition(HttpServletRequest)
and each instance contains the matching parameter expressions only or is otherwise empty.