public class Jackson2ServerHttpMessageWriter extends AbstractServerHttpMessageWriter<Object>
ServerHttpMessageWriter that resolves those annotation or request based Jackson 2 hints:
@JsonView annotated handler methodJsonView| Constructor and Description |
|---|
Jackson2ServerHttpMessageWriter(org.springframework.core.codec.Encoder<Object> encoder) |
Jackson2ServerHttpMessageWriter(HttpMessageWriter<Object> writer) |
| Modifier and Type | Method and Description |
|---|---|
protected Map<String,Object> |
resolveWriteHints(org.springframework.core.ResolvableType streamType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request)
Invoked before writing the response to resolve hints by
AbstractServerHttpMessageWriter.write(Publisher, ResolvableType, ResolvableType, MediaType, ServerHttpRequest, ServerHttpResponse, Map). |
canWrite, getWritableMediaTypes, write, writepublic Jackson2ServerHttpMessageWriter(org.springframework.core.codec.Encoder<Object> encoder)
public Jackson2ServerHttpMessageWriter(HttpMessageWriter<Object> writer)
protected Map<String,Object> resolveWriteHints(org.springframework.core.ResolvableType streamType, org.springframework.core.ResolvableType elementType, MediaType mediaType, ServerHttpRequest request)
AbstractServerHttpMessageWriterAbstractServerHttpMessageWriter.write(Publisher, ResolvableType, ResolvableType, MediaType, ServerHttpRequest, ServerHttpResponse, Map).resolveWriteHints in class AbstractServerHttpMessageWriter<Object>streamType - the original type used for the method return value. For annotation
based controllers, the MethodParameter is available via ResolvableType.getSource().elementType - the stream element type to processmediaType - the content type to use when writing. May be null to
indicate that the default content type of the converter must be used.request - the current HTTP request