public class WebCmsEndpointCondition extends com.foreach.across.modules.web.mvc.condition.AbstractCustomRequestCondition<WebCmsEndpointCondition>
WebCmsEndpoint. This condition takes all properties of
WebCmsEndpointMapping into account.CustomRequestCondition| Constructor and Description |
|---|
WebCmsEndpointCondition() |
| Modifier and Type | Method and Description |
|---|---|
WebCmsEndpointCondition |
combine(WebCmsEndpointCondition other)
Two conditions are merged by modifying this instance of
WebCmsEndpointCondition. |
int |
compareTo(WebCmsEndpointCondition other,
javax.servlet.http.HttpServletRequest request)
Returns -1, 0 or 1 if the current
WebCmsEndpointCondition is more specific, equally specific or less specific
than the given condition. |
protected Collection<?> |
getContent() |
WebCmsEndpointCondition |
getMatchingCondition(javax.servlet.http.HttpServletRequest request)
A condition can only match if the resolved
WebCmsEndpointContext has an endpoint of the correct class and
a url with correct statuscode. |
protected String |
getToStringInfix() |
void |
setAnnotatedElement(AnnotatedElement annotatedElement)
Set the values for this condition based on the attributes of the annotated element.
|
public void setAnnotatedElement(AnnotatedElement annotatedElement)
annotatedElement - this condition is attached toprotected Collection<?> getContent()
getContent in class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebCmsEndpointCondition>protected String getToStringInfix()
getToStringInfix in class org.springframework.web.servlet.mvc.condition.AbstractRequestCondition<WebCmsEndpointCondition>public WebCmsEndpointCondition combine(WebCmsEndpointCondition other)
Two conditions are merged by modifying this instance of WebCmsEndpointCondition.
The classes of the conditions are combined to the most specific child in the inheritance tree. If the two
WebCmsEndpoint types are unrelated, a InvalidWebCmsConditionCombination is thrown.
Both the HttpStatuses and HttpStatus.Series are combined.
To combine these arrays we take the intersection of both arrays if both are not empty. If only one array is not empty, we take
this one. If both are empty, keep them empty.
The resulting array of HttpStatuses will be appended with statuses that are in one's status and in other ones series.
public WebCmsEndpointCondition getMatchingCondition(javax.servlet.http.HttpServletRequest request)
WebCmsEndpointContext has an endpoint of the correct class and
a url with correct statuscode.
Only the matching HttpStatus or HttpStatus.Series from the WebCmsEndpointContext is put on the resulting condition
request - The HttpServletRequest which is used for resolving the WebCmsEndpointContextHttpStatus from the WebCmsEndpointContextpublic int compareTo(WebCmsEndpointCondition other, javax.servlet.http.HttpServletRequest request)
WebCmsEndpointCondition is more specific, equally specific or less specific
than the given condition. How specific a WebCmsEndpointCondition is, is first determined by the class of
the WebCmsEndpoint. Secondly, the number of HttpStatuses is compared and lastly, the number of
HttpStatus.Series is checked.other - The WebCmsEndpointCondition to compare withrequest - The current HttpServletRequest. This is not considered for comparingWebCmsEndpointCondition is more specific, equally specific or less specific
than the given conditionCopyright © 2020. All rights reserved.