|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.servlet.mvc.condition.AbstractRequestCondition<RequestConditionHolder>
org.springframework.web.servlet.mvc.condition.RequestConditionHolder
public final class RequestConditionHolder
A holder for a RequestCondition
useful when the type of the request
condition is not known ahead of time, e.g. custom condition. Since this
class is also an implementation of RequestCondition
, effectively it
decorates the held request condition and allows it to be combined and compared
with other request conditions in a type and null safe way.
When two RequestConditionHolder
instances are combined or compared
with each other, it is expected the conditions they hold are of the same type.
If they are not, a ClassCastException
is raised.
Constructor Summary | |
---|---|
RequestConditionHolder(RequestCondition<?> requestCondition)
Create a new holder to wrap the given request condition. |
Method Summary | |
---|---|
RequestConditionHolder |
combine(RequestConditionHolder other)
Combine the request conditions held by the two RequestConditionHolder instances after making sure the conditions are of the same type. |
int |
compareTo(RequestConditionHolder other,
javax.servlet.http.HttpServletRequest request)
Compare the request conditions held by the two RequestConditionHolder instances after making sure the conditions are of the same type. |
RequestCondition<?> |
getCondition()
Return the held request condition, or null if not holding one. |
protected java.util.Collection<?> |
getContent()
Return the discrete items a request condition is composed of. |
RequestConditionHolder |
getMatchingCondition(javax.servlet.http.HttpServletRequest request)
Get the matching condition for the held request condition wrap it in a new RequestConditionHolder instance. |
protected java.lang.String |
getToStringInfix()
The notation to use when printing discrete items of content. |
Methods inherited from class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RequestConditionHolder(RequestCondition<?> requestCondition)
requestCondition
- the condition to hold, may be null
Method Detail |
---|
public RequestCondition<?> getCondition()
null
if not holding one.
protected java.util.Collection<?> getContent()
AbstractRequestCondition
getContent
in class AbstractRequestCondition<RequestConditionHolder>
null
protected java.lang.String getToStringInfix()
AbstractRequestCondition
getToStringInfix
in class AbstractRequestCondition<RequestConditionHolder>
public RequestConditionHolder combine(RequestConditionHolder other)
other
- the condition to combine with.
public RequestConditionHolder getMatchingCondition(javax.servlet.http.HttpServletRequest request)
null
if there is no match.public int compareTo(RequestConditionHolder other, javax.servlet.http.HttpServletRequest request)
|
spring-webmvc | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |