Package | Description |
---|---|
org.springframework.http |
Contains a basic abstraction over client/server-side HTTP.
|
org.springframework.http.codec |
Provides implementations of
Encoder
and Decoder for web use. |
org.springframework.http.codec.json |
JSON encoder and decoder support.
|
org.springframework.http.codec.multipart |
Multipart support.
|
org.springframework.http.converter |
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
|
org.springframework.http.converter.feed |
Provides HttpMessageConverter implementations for handling Atom and RSS feeds.
|
org.springframework.http.converter.json |
Provides HttpMessageConverter implementations for handling JSON.
|
org.springframework.http.converter.protobuf |
Provides an HttpMessageConverter implementation for handling
Google Protocol Buffers.
|
org.springframework.http.converter.xml |
Provides HttpMessageConverter implementations for handling XML.
|
org.springframework.web |
Common, generic interfaces that define minimal boundary points
between Spring's web infrastructure and other framework modules.
|
org.springframework.web.accept |
This package contains classes used to determine the requested the media types in a request.
|
org.springframework.web.server |
Core interfaces and classes for Spring's generic, reactive web support.
|
Modifier and Type | Field and Description |
---|---|
static MediaType |
MediaType.ALL
Public constant media type that includes all media ranges (i.e.
|
static MediaType |
MediaType.APPLICATION_ATOM_XML
Public constant media type for
application/atom+xml . |
static MediaType |
MediaType.APPLICATION_FORM_URLENCODED
Public constant media type for
application/x-www-form-urlencoded . |
static MediaType |
MediaType.APPLICATION_JSON
Public constant media type for
application/json . |
static MediaType |
MediaType.APPLICATION_JSON_UTF8
Public constant media type for
application/json;charset=UTF-8 . |
static MediaType |
MediaType.APPLICATION_OCTET_STREAM
Public constant media type for
application/octet-stream . |
static MediaType |
MediaType.APPLICATION_PDF
Public constant media type for
application/pdf . |
static MediaType |
MediaType.APPLICATION_PROBLEM_JSON
Public constant media type for
application/problem+json . |
static MediaType |
MediaType.APPLICATION_PROBLEM_JSON_UTF8
Public constant media type for
application/problem+json . |
static MediaType |
MediaType.APPLICATION_PROBLEM_XML
Public constant media type for
application/problem+xml . |
static MediaType |
MediaType.APPLICATION_RSS_XML
Public constant media type for
application/rss+xml . |
static MediaType |
MediaType.APPLICATION_STREAM_JSON
Public constant media type for
application/stream+json . |
static MediaType |
MediaType.APPLICATION_XHTML_XML
Public constant media type for
application/xhtml+xml . |
static MediaType |
MediaType.APPLICATION_XML
Public constant media type for
application/xml . |
static MediaType |
MediaType.IMAGE_GIF
Public constant media type for
image/gif . |
static MediaType |
MediaType.IMAGE_JPEG
Public constant media type for
image/jpeg . |
static MediaType |
MediaType.IMAGE_PNG
Public constant media type for
image/png . |
static MediaType |
MediaType.MULTIPART_FORM_DATA
Public constant media type for
multipart/form-data . |
static MediaType |
MediaType.TEXT_EVENT_STREAM
Public constant media type for
text/event-stream . |
static MediaType |
MediaType.TEXT_HTML
Public constant media type for
text/html . |
static MediaType |
MediaType.TEXT_MARKDOWN
Public constant media type for
text/markdown . |
static MediaType |
MediaType.TEXT_PLAIN
Public constant media type for
text/plain . |
static MediaType |
MediaType.TEXT_XML
Public constant media type for
text/xml . |
Modifier and Type | Field and Description |
---|---|
static java.util.Comparator<MediaType> |
MediaType.QUALITY_VALUE_COMPARATOR
Comparator used by
sortByQualityValue(List) . |
static java.util.Comparator<MediaType> |
MediaType.SPECIFICITY_COMPARATOR
Comparator used by
sortBySpecificity(List) . |
Modifier and Type | Method and Description |
---|---|
static MediaType |
MediaType.asMediaType(org.springframework.util.MimeType mimeType)
Re-create the given mime type as a media type.
|
MediaType |
MediaType.copyQualityValue(MediaType mediaType)
Return a replica of this instance with the quality value of the given MediaType.
|
MediaType |
HttpHeaders.getContentType()
Return the media type of the body, as specified
by the
Content-Type header. |
static MediaType |
MediaType.parseMediaType(java.lang.String mediaType)
Parse the given String into a single
MediaType . |
MediaType |
MediaType.removeQualityValue()
Return a replica of this instance with its quality value removed.
|
static MediaType |
MediaType.valueOf(java.lang.String value)
Parse the given String value into a
MediaType object,
with this method name following the 'valueOf' naming convention
(as supported by ConversionService . |
Modifier and Type | Method and Description |
---|---|
static java.util.List<MediaType> |
MediaType.asMediaTypes(java.util.List<org.springframework.util.MimeType> mimeTypes)
Re-create the given mime types as media types.
|
java.util.List<MediaType> |
HttpHeaders.getAccept()
Return the list of acceptable media types,
as specified by the
Accept header. |
static java.util.Optional<MediaType> |
MediaTypeFactory.getMediaType(org.springframework.core.io.Resource resource)
Determine a media type for the given resource, if possible.
|
static java.util.Optional<MediaType> |
MediaTypeFactory.getMediaType(java.lang.String filename)
Determine a media type for the given file name, if possible.
|
static java.util.List<MediaType> |
MediaTypeFactory.getMediaTypes(java.lang.String filename)
Determine the media types for the given file name, if possible.
|
static java.util.List<MediaType> |
MediaType.parseMediaTypes(java.util.List<java.lang.String> mediaTypes)
Parse the given list of (potentially) comma-separated strings into a
list of
MediaType objects. |
static java.util.List<MediaType> |
MediaType.parseMediaTypes(java.lang.String mediaTypes)
Parse the given comma-separated string into a list of
MediaType objects. |
Modifier and Type | Method and Description |
---|---|
B |
RequestEntity.HeadersBuilder.accept(MediaType... acceptableMediaTypes)
Set the list of acceptable media types, as
specified by the
Accept header. |
ResponseEntity.BodyBuilder |
ResponseEntity.BodyBuilder.contentType(MediaType contentType)
Set the media type of the body, as specified by the
Content-Type header. |
RequestEntity.BodyBuilder |
RequestEntity.BodyBuilder.contentType(MediaType contentType)
Set the media type of the body, as specified
by the
Content-Type header. |
MediaType |
MediaType.copyQualityValue(MediaType mediaType)
Return a replica of this instance with the quality value of the given MediaType.
|
boolean |
MediaType.includes(MediaType other)
Indicate whether this
MediaType includes the given media type. |
boolean |
MediaType.isCompatibleWith(MediaType other)
Indicate whether this
MediaType is compatible with the given media type. |
void |
HttpHeaders.setContentType(MediaType mediaType)
Set the media type of the body,
as specified by the
Content-Type header. |
Modifier and Type | Method and Description |
---|---|
void |
HttpHeaders.setAccept(java.util.List<MediaType> acceptableMediaTypes)
Set the list of acceptable media types,
as specified by the
Accept header. |
static void |
MediaType.sortByQualityValue(java.util.List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by quality value. |
static void |
MediaType.sortBySpecificity(java.util.List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by specificity. |
static void |
MediaType.sortBySpecificityAndQuality(java.util.List<MediaType> mediaTypes)
Sorts the given list of
MediaType objects by specificity as the
primary criteria and quality value the secondary. |
static java.lang.String |
MediaType.toString(java.util.Collection<MediaType> mediaTypes)
Return a string representation of the given list of
MediaType objects. |
Constructor and Description |
---|
MediaType(MediaType other,
java.nio.charset.Charset charset)
Copy-constructor that copies the type, subtype and parameters of the given
MediaType , and allows to set the specified character set. |
MediaType(MediaType other,
java.util.Map<java.lang.String,java.lang.String> parameters)
Copy-constructor that copies the type and subtype of the given
MediaType ,
and allows for different parameter. |
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
ServerSentEventHttpMessageReader.getReadableMediaTypes() |
java.util.List<MediaType> |
HttpMessageReader.getReadableMediaTypes()
Return the
MediaType 's that this reader supports. |
java.util.List<MediaType> |
FormHttpMessageReader.getReadableMediaTypes() |
java.util.List<MediaType> |
DecoderHttpMessageReader.getReadableMediaTypes() |
java.util.List<MediaType> |
HttpMessageEncoder.getStreamingMediaTypes()
Return "streaming" media types for which flushing should be performed
automatically vs at the end of the input stream.
|
java.util.List<MediaType> |
ResourceHttpMessageWriter.getWritableMediaTypes() |
java.util.List<MediaType> |
ServerSentEventHttpMessageWriter.getWritableMediaTypes() |
java.util.List<MediaType> |
FormHttpMessageWriter.getWritableMediaTypes() |
java.util.List<MediaType> |
HttpMessageWriter.getWritableMediaTypes()
Return the
MediaType 's that this writer supports. |
java.util.List<MediaType> |
EncoderHttpMessageWriter.getWritableMediaTypes() |
Modifier and Type | Method and Description |
---|---|
boolean |
ServerSentEventHttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
HttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this reader.
|
boolean |
FormHttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
DecoderHttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
ResourceHttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
ServerSentEventHttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
FormHttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
HttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType)
Whether the given object type is supported by this writer.
|
boolean |
EncoderHttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
default java.util.Map<java.lang.String,java.lang.Object> |
HttpMessageEncoder.getEncodeHints(org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response)
Get decoding hints based on the server request or annotations on the
target controller method parameter.
|
protected java.util.Map<java.lang.String,java.lang.Object> |
EncoderHttpMessageWriter.getWriteHints(org.springframework.core.ResolvableType streamType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response)
Get additional hints for encoding for example based on the server request
or annotations from controller method parameters.
|
reactor.core.publisher.Mono<java.lang.Void> |
ServerSentEventHttpMessageWriter.write(org.reactivestreams.Publisher<?> input,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Void> |
ServerSentEventHttpMessageWriter.write(org.reactivestreams.Publisher<?> input,
org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Void> |
FormHttpMessageWriter.write(org.reactivestreams.Publisher<? extends org.springframework.util.MultiValueMap<java.lang.String,java.lang.String>> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Void> |
ResourceHttpMessageWriter.write(org.reactivestreams.Publisher<? extends org.springframework.core.io.Resource> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Void> |
ResourceHttpMessageWriter.write(org.reactivestreams.Publisher<? extends org.springframework.core.io.Resource> inputStream,
org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints) |
reactor.core.publisher.Mono<java.lang.Void> |
HttpMessageWriter.write(org.reactivestreams.Publisher<? extends T> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints)
Write an given stream of object to the output message.
|
reactor.core.publisher.Mono<java.lang.Void> |
EncoderHttpMessageWriter.write(org.reactivestreams.Publisher<? extends T> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage message,
java.util.Map<java.lang.String,java.lang.Object> hints) |
default reactor.core.publisher.Mono<java.lang.Void> |
HttpMessageWriter.write(org.reactivestreams.Publisher<? extends T> inputStream,
org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints)
Server-side only alternative to
HttpMessageWriter.write(Publisher, ResolvableType, MediaType, ReactiveHttpOutputMessage, Map)
with additional context available. |
reactor.core.publisher.Mono<java.lang.Void> |
EncoderHttpMessageWriter.write(org.reactivestreams.Publisher<? extends T> inputStream,
org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response,
java.util.Map<java.lang.String,java.lang.Object> hints) |
Modifier and Type | Field and Description |
---|---|
protected java.util.List<MediaType> |
AbstractJackson2Encoder.streamingMediaTypes |
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
AbstractJackson2Encoder.getStreamingMediaTypes() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
AbstractJackson2Encoder.getEncodeHints(org.springframework.core.ResolvableType actualType,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ServerHttpRequest request,
ServerHttpResponse response) |
Modifier and Type | Method and Description |
---|---|
void |
AbstractJackson2Encoder.setStreamingMediaTypes(java.util.List<MediaType> mediaTypes)
Configure "streaming" media types for which flushing should be performed
automatically vs at the end of the stream.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
MultipartHttpMessageReader.getReadableMediaTypes() |
java.util.List<MediaType> |
SynchronossPartHttpMessageReader.getReadableMediaTypes() |
java.util.List<MediaType> |
MultipartHttpMessageWriter.getWritableMediaTypes() |
Modifier and Type | Method and Description |
---|---|
boolean |
MultipartHttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
SynchronossPartHttpMessageReader.canRead(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
boolean |
MultipartHttpMessageWriter.canWrite(org.springframework.core.ResolvableType elementType,
MediaType mediaType) |
reactor.core.publisher.Mono<java.lang.Void> |
MultipartHttpMessageWriter.write(org.reactivestreams.Publisher<? extends org.springframework.util.MultiValueMap<java.lang.String,?>> inputStream,
org.springframework.core.ResolvableType elementType,
MediaType mediaType,
ReactiveHttpOutputMessage outputMessage,
java.util.Map<java.lang.String,java.lang.Object> hints) |
Modifier and Type | Method and Description |
---|---|
MediaType |
BufferedImageHttpMessageConverter.getDefaultContentType()
Returns the default
Content-Type to be used for writing. |
protected MediaType |
ResourceRegionHttpMessageConverter.getDefaultContentType(java.lang.Object object) |
protected MediaType |
ResourceHttpMessageConverter.getDefaultContentType(org.springframework.core.io.Resource resource) |
protected MediaType |
AbstractHttpMessageConverter.getDefaultContentType(T t)
Returns the default content type for the given type.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
FormHttpMessageConverter.getSupportedMediaTypes() |
java.util.List<MediaType> |
BufferedImageHttpMessageConverter.getSupportedMediaTypes() |
java.util.List<MediaType> |
AbstractHttpMessageConverter.getSupportedMediaTypes() |
java.util.List<MediaType> |
HttpMessageConverter.getSupportedMediaTypes()
Return the list of
MediaType objects supported by this converter. |
Modifier and Type | Method and Description |
---|---|
protected void |
AbstractHttpMessageConverter.addDefaultHeaders(HttpHeaders headers,
T t,
MediaType contentType)
Add default headers to the output message.
|
boolean |
ResourceRegionHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
FormHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
ObjectToStringHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
BufferedImageHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
AbstractHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType)
This implementation checks if the given class is supported,
and if the supported media types
include the given media type.
|
boolean |
HttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType)
Indicates whether the given class can be read by this converter.
|
protected boolean |
AbstractHttpMessageConverter.canRead(MediaType mediaType)
|
boolean |
ResourceRegionHttpMessageConverter.canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
MediaType mediaType) |
boolean |
AbstractGenericHttpMessageConverter.canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
MediaType mediaType) |
boolean |
GenericHttpMessageConverter.canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
MediaType mediaType)
Indicates whether the given type can be read by this converter.
|
boolean |
ResourceRegionHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
FormHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
ObjectToStringHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
BufferedImageHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
AbstractHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType)
|
boolean |
HttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType)
Indicates whether the given class can be written by this converter.
|
protected boolean |
AbstractHttpMessageConverter.canWrite(MediaType mediaType)
Returns
true if the given media type includes any of the
supported media types. |
boolean |
ResourceRegionHttpMessageConverter.canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
AbstractGenericHttpMessageConverter.canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
GenericHttpMessageConverter.canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
MediaType mediaType)
Indicates whether the given class can be written by this converter.
|
protected java.lang.Long |
ByteArrayHttpMessageConverter.getContentLength(byte[] bytes,
MediaType contentType) |
protected java.lang.Long |
ObjectToStringHttpMessageConverter.getContentLength(java.lang.Object obj,
MediaType contentType) |
protected java.lang.Long |
ResourceHttpMessageConverter.getContentLength(org.springframework.core.io.Resource resource,
MediaType contentType) |
protected java.lang.Long |
StringHttpMessageConverter.getContentLength(java.lang.String str,
MediaType contentType) |
protected java.lang.Long |
AbstractHttpMessageConverter.getContentLength(T t,
MediaType contentType)
Returns the content length for the given type.
|
void |
BufferedImageHttpMessageConverter.setDefaultContentType(MediaType defaultContentType)
Sets the default
Content-Type to be used for writing. |
void |
BufferedImageHttpMessageConverter.write(java.awt.image.BufferedImage image,
MediaType contentType,
HttpOutputMessage outputMessage) |
void |
FormHttpMessageConverter.write(org.springframework.util.MultiValueMap<java.lang.String,?> map,
MediaType contentType,
HttpOutputMessage outputMessage) |
void |
AbstractHttpMessageConverter.write(T t,
MediaType contentType,
HttpOutputMessage outputMessage)
This implementation sets the default headers by calling
AbstractHttpMessageConverter.addDefaultHeaders(org.springframework.http.HttpHeaders, T, org.springframework.http.MediaType) ,
and then calls AbstractHttpMessageConverter.writeInternal(T, org.springframework.http.HttpOutputMessage) . |
void |
HttpMessageConverter.write(T t,
MediaType contentType,
HttpOutputMessage outputMessage)
Write an given object to the given output message.
|
void |
AbstractGenericHttpMessageConverter.write(T t,
java.lang.reflect.Type type,
MediaType contentType,
HttpOutputMessage outputMessage)
This implementation sets the default headers by calling
AbstractHttpMessageConverter.addDefaultHeaders(org.springframework.http.HttpHeaders, T, org.springframework.http.MediaType) ,
and then calls AbstractGenericHttpMessageConverter.writeInternal(T, org.springframework.http.HttpOutputMessage) . |
void |
GenericHttpMessageConverter.write(T t,
java.lang.reflect.Type type,
MediaType contentType,
HttpOutputMessage outputMessage)
Write an given object to the given output message.
|
Modifier and Type | Method and Description |
---|---|
void |
FormHttpMessageConverter.setSupportedMediaTypes(java.util.List<MediaType> supportedMediaTypes)
Set the list of
MediaType objects supported by this converter. |
void |
AbstractHttpMessageConverter.setSupportedMediaTypes(java.util.List<MediaType> supportedMediaTypes)
Set the list of
MediaType objects supported by this converter. |
Constructor and Description |
---|
AbstractGenericHttpMessageConverter(MediaType... supportedMediaTypes)
Construct an
AbstractGenericHttpMessageConverter with multiple supported media type. |
AbstractGenericHttpMessageConverter(MediaType supportedMediaType)
Construct an
AbstractGenericHttpMessageConverter with one supported media type. |
AbstractHttpMessageConverter(java.nio.charset.Charset defaultCharset,
MediaType... supportedMediaTypes)
Construct an
AbstractHttpMessageConverter with a default charset and
multiple supported media types. |
AbstractHttpMessageConverter(MediaType... supportedMediaTypes)
Construct an
AbstractHttpMessageConverter with multiple supported media types. |
AbstractHttpMessageConverter(MediaType supportedMediaType)
Construct an
AbstractHttpMessageConverter with one supported media type. |
Constructor and Description |
---|
AbstractWireFeedHttpMessageConverter(MediaType supportedMediaType) |
Modifier and Type | Method and Description |
---|---|
protected MediaType |
AbstractJackson2HttpMessageConverter.getDefaultContentType(java.lang.Object object) |
Modifier and Type | Method and Description |
---|---|
boolean |
AbstractJackson2HttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
AbstractJackson2HttpMessageConverter.canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
MediaType mediaType) |
boolean |
AbstractJackson2HttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
protected java.lang.Long |
AbstractJackson2HttpMessageConverter.getContentLength(java.lang.Object object,
MediaType contentType) |
protected JsonEncoding |
AbstractJackson2HttpMessageConverter.getJsonEncoding(MediaType contentType)
Determine the JSON encoding to use for the given content type.
|
Constructor and Description |
---|
AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper,
MediaType... supportedMediaTypes) |
AbstractJackson2HttpMessageConverter(ObjectMapper objectMapper,
MediaType supportedMediaType) |
Modifier and Type | Field and Description |
---|---|
static MediaType |
ProtobufHttpMessageConverter.PROTOBUF |
Modifier and Type | Method and Description |
---|---|
protected MediaType |
ProtobufHttpMessageConverter.getDefaultContentType(com.google.protobuf.Message message) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
ProtobufHttpMessageConverter.canWrite(MediaType mediaType) |
Modifier and Type | Method and Description |
---|---|
boolean |
MarshallingHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
Jaxb2RootElementHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
Jaxb2CollectionHttpMessageConverter.canRead(java.lang.Class<?> clazz,
MediaType mediaType)
Always returns
false since Jaxb2CollectionHttpMessageConverter
required generic type information in order to read a Collection. |
boolean |
Jaxb2CollectionHttpMessageConverter.canRead(java.lang.reflect.Type type,
java.lang.Class<?> contextClass,
MediaType mediaType)
Indicates whether the given type can be read by this converter.
|
boolean |
MarshallingHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
Jaxb2RootElementHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType) |
boolean |
Jaxb2CollectionHttpMessageConverter.canWrite(java.lang.Class<?> clazz,
MediaType mediaType)
Always returns
false since Jaxb2CollectionHttpMessageConverter
does not convert collections to XML. |
boolean |
Jaxb2CollectionHttpMessageConverter.canWrite(java.lang.reflect.Type type,
java.lang.Class<?> clazz,
MediaType mediaType)
Always returns
false since Jaxb2CollectionHttpMessageConverter
does not convert collections to XML. |
protected java.lang.Long |
SourceHttpMessageConverter.getContentLength(T t,
MediaType contentType) |
void |
Jaxb2CollectionHttpMessageConverter.write(T t,
java.lang.reflect.Type type,
MediaType contentType,
HttpOutputMessage outputMessage) |
Modifier and Type | Method and Description |
---|---|
MediaType |
HttpMediaTypeNotSupportedException.getContentType()
Return the HTTP request content type method that caused the failure.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
HttpMediaTypeException.getSupportedMediaTypes()
Return the list of supported media types.
|
Constructor and Description |
---|
HttpMediaTypeNotSupportedException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.
|
HttpMediaTypeNotSupportedException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes,
java.lang.String msg)
Create a new HttpMediaTypeNotSupportedException.
|
Constructor and Description |
---|
HttpMediaTypeException(java.lang.String message,
java.util.List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeException with a list of supported media types.
|
HttpMediaTypeNotAcceptableException(java.util.List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.
|
HttpMediaTypeNotSupportedException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes)
Create a new HttpMediaTypeNotSupportedException.
|
HttpMediaTypeNotSupportedException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes,
java.lang.String msg)
Create a new HttpMediaTypeNotSupportedException.
|
Modifier and Type | Method and Description |
---|---|
MediaType |
PathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource resource)
A public method exposing the knowledge of the path extension strategy to
resolve file extensions to a
MediaType in this case for a given
Resource . |
MediaType |
ServletPathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource resource)
Extends the base class
PathExtensionContentNegotiationStrategy.getMediaTypeForResource(org.springframework.core.io.Resource)
with the ability to also look up through the ServletContext. |
protected MediaType |
AbstractMappingContentNegotiationStrategy.handleNoMatch(NativeWebRequest request,
java.lang.String key)
Override to provide handling when a key is not resolved via.
|
protected MediaType |
ServletPathExtensionContentNegotiationStrategy.handleNoMatch(NativeWebRequest webRequest,
java.lang.String extension)
Resolve file extension via
ServletContext.getMimeType(String)
and also delegate to base class for a potential
MediaTypeFactory lookup. |
protected MediaType |
MappingMediaTypeFileExtensionResolver.lookupMediaType(java.lang.String extension)
Use this method for a reverse lookup from extension to MediaType.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.List<MediaType> |
MappingMediaTypeFileExtensionResolver.getAllMediaTypes() |
java.util.List<MediaType> |
FixedContentNegotiationStrategy.getContentTypes()
Return the configured list of media types.
|
java.util.Map<java.lang.String,MediaType> |
MappingMediaTypeFileExtensionResolver.getMediaTypes() |
java.util.List<MediaType> |
AbstractMappingContentNegotiationStrategy.resolveMediaTypeKey(NativeWebRequest webRequest,
java.lang.String key)
An alternative to
AbstractMappingContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest) that accepts
an already extracted key. |
java.util.List<MediaType> |
ContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest webRequest)
Resolve the given request to a list of media types.
|
java.util.List<MediaType> |
ContentNegotiationManager.resolveMediaTypes(NativeWebRequest request) |
java.util.List<MediaType> |
AbstractMappingContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest webRequest) |
java.util.List<MediaType> |
FixedContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest request) |
java.util.List<MediaType> |
HeaderContentNegotiationStrategy.resolveMediaTypes(NativeWebRequest request)
Resolve the given request to a list of media types.
|
Modifier and Type | Method and Description |
---|---|
protected void |
MappingMediaTypeFileExtensionResolver.addMapping(java.lang.String extension,
MediaType mediaType)
Map an extension to a MediaType.
|
void |
ContentNegotiationManagerFactoryBean.addMediaType(java.lang.String fileExtension,
MediaType mediaType)
An alternative to
ContentNegotiationManagerFactoryBean.setMediaTypes(java.util.Properties) for use in Java code. |
protected void |
AbstractMappingContentNegotiationStrategy.handleMatch(java.lang.String key,
MediaType mediaType)
Override to provide handling when a key is successfully resolved via
MappingMediaTypeFileExtensionResolver.lookupMediaType(java.lang.String) . |
java.util.List<java.lang.String> |
MappingMediaTypeFileExtensionResolver.resolveFileExtensions(MediaType mediaType) |
java.util.List<java.lang.String> |
ContentNegotiationManager.resolveFileExtensions(MediaType mediaType) |
java.util.List<java.lang.String> |
MediaTypeFileExtensionResolver.resolveFileExtensions(MediaType mediaType)
Resolve the given media type to a list of path extensions.
|
void |
ContentNegotiationManagerFactoryBean.setDefaultContentType(MediaType contentType)
Set the default content type to use when no content type is requested.
|
Modifier and Type | Method and Description |
---|---|
void |
ContentNegotiationManagerFactoryBean.addMediaTypes(java.util.Map<java.lang.String,MediaType> mediaTypes)
An alternative to
ContentNegotiationManagerFactoryBean.setMediaTypes(java.util.Properties) for use in Java code. |
void |
ContentNegotiationManagerFactoryBean.setDefaultContentTypes(java.util.List<MediaType> contentTypes)
Set the default content types to use when no content type is requested.
|
Constructor and Description |
---|
FixedContentNegotiationStrategy(MediaType contentType)
Constructor with a single default
MediaType . |
Constructor and Description |
---|
AbstractMappingContentNegotiationStrategy(java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given map of file extensions and media types.
|
FixedContentNegotiationStrategy(java.util.List<MediaType> contentTypes)
Constructor with an ordered List of default
MediaType 's to return
for use in applications that support a variety of content types. |
MappingMediaTypeFileExtensionResolver(java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given map of file extensions and media types.
|
ParameterContentNegotiationStrategy(java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given map of file extensions and media types.
|
PathExtensionContentNegotiationStrategy(java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given map of file extensions and media types.
|
ServletPathExtensionContentNegotiationStrategy(ServletContext servletContext,
java.util.Map<java.lang.String,MediaType> mediaTypes)
Create an instance with the given extension-to-MediaType lookup.
|
Modifier and Type | Method and Description |
---|---|
MediaType |
UnsupportedMediaTypeStatusException.getContentType()
Return the request Content-Type header if it was parsed successfully,
or
null otherwise. |
Modifier and Type | Method and Description |
---|---|
java.util.List<MediaType> |
MediaTypeNotSupportedStatusException.getSupportedMediaTypes()
Return the list of supported content types in cases when the Accept
header is parsed but not supported, or an empty list otherwise.
|
java.util.List<MediaType> |
NotAcceptableStatusException.getSupportedMediaTypes()
Return the list of supported content types in cases when the Accept
header is parsed but not supported, or an empty list otherwise.
|
java.util.List<MediaType> |
UnsupportedMediaTypeStatusException.getSupportedMediaTypes()
Return the list of supported content types in cases when the Content-Type
header is parsed but not supported, or an empty list otherwise.
|
Constructor and Description |
---|
UnsupportedMediaTypeStatusException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes)
Constructor for when the Content-Type can be parsed but is not supported.
|
Constructor and Description |
---|
MediaTypeNotSupportedStatusException(java.util.List<MediaType> supportedMediaTypes)
Constructor for when the Content-Type is not supported.
|
NotAcceptableStatusException(java.util.List<MediaType> supportedMediaTypes)
Constructor for when requested Content-Type is not supported.
|
UnsupportedMediaTypeStatusException(MediaType contentType,
java.util.List<MediaType> supportedMediaTypes)
Constructor for when the Content-Type can be parsed but is not supported.
|