Package io.microsphere.spring.web.rule
Class WebRequestProducesRule
java.lang.Object
io.microsphere.spring.web.rule.AbstractWebRequestRule<ProduceMediaTypeExpression>
io.microsphere.spring.web.rule.WebRequestProducesRule
- All Implemented Interfaces:
WebRequestRule
WebRequest
Produces WebRequestRule
A logical disjunction (' || ') request condition to match a request's 'Accept' header
to a list of media type expressions. Two kinds of media type expressions are
supported, which are described in RequestMapping.produces()
and
RequestMapping.headers()
where the header name is 'Accept'.
Regardless of which syntax is used, the semantics are the same.
- Since:
- 1.0.066
- Author:
- Arjen Poutsma, Rossen Stoyanchev, Mercy
- See Also:
-
WebRequestRule
org.springframework.web.servlet.mvc.condition.ProducesRequestCondition
org.springframework.web.reactive.result.condition.ProducesRequestCondition
-
Constructor Summary
ConstructorsConstructorDescriptionWebRequestProducesRule
(String... produces) WebRequestProducesRule
(String[] produces, String... headers) WebRequestProducesRule
(String[] produces, String[] headers, org.springframework.web.accept.ContentNegotiationManager manager) -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<ProduceMediaTypeExpression>
Return the discrete items a request condition is composed of.protected String
The notation to use when printing discrete items of content.boolean
matches
(org.springframework.web.context.request.NativeWebRequest request) Methods inherited from class io.microsphere.spring.web.rule.AbstractWebRequestRule
equals, hashCode, isEmpty, toString
-
Constructor Details
-
WebRequestProducesRule
-
WebRequestProducesRule
-
WebRequestProducesRule
-
-
Method Details
-
getContent
Description copied from class:AbstractWebRequestRule
Return the discrete items a request condition is composed of.For example URL patterns, HTTP request methods, param expressions, etc.
- Specified by:
getContent
in classAbstractWebRequestRule<ProduceMediaTypeExpression>
- Returns:
- a collection of objects (never
null
)
-
getToStringInfix
Description copied from class:AbstractWebRequestRule
The notation to use when printing discrete items of content.For example
" || "
for URL patterns or" && "
for param expressions.- Specified by:
getToStringInfix
in classAbstractWebRequestRule<ProduceMediaTypeExpression>
-
matches
public boolean matches(org.springframework.web.context.request.NativeWebRequest request)
-