程序包 org.springframework.http.converter
Provides an HttpMessageConverter abstraction to convert between Java objects and HTTP input/output messages.
接口概要 接口 说明 GenericHttpMessageConverter<T> A specialization ofHttpMessageConverter
that can convert an HTTP request into a target object of a specified generic type and a source object of a specified generic type into an HTTP response.HttpMessageConverter<T> Strategy interface for converting from and to HTTP requests and responses.类概要 类 说明 AbstractGenericHttpMessageConverter<T> Abstract base class for mostGenericHttpMessageConverter
implementations.AbstractHttpMessageConverter<T> Abstract base class for mostHttpMessageConverter
implementations.BufferedImageHttpMessageConverter Implementation ofHttpMessageConverter
that can read and writeBufferedImages
.ByteArrayHttpMessageConverter Implementation ofHttpMessageConverter
that can read and write byte arrays.FormHttpMessageConverter Implementation ofHttpMessageConverter
to read and write 'normal' HTML forms and also to write (but not read) multipart data (e.g. file uploads).ObjectToStringHttpMessageConverter AnHttpMessageConverter
that usesStringHttpMessageConverter
for reading and writing content and aConversionService
for converting the String content to and from the target object type.ResourceHttpMessageConverter Implementation ofHttpMessageConverter
that can read/writeResources
and supports byte range requests.ResourceRegionHttpMessageConverter Implementation ofHttpMessageConverter
that can write a singleResourceRegion
, or Collections ofResourceRegions
.StringHttpMessageConverter Implementation ofHttpMessageConverter
that can read and write strings.异常错误概要 异常错误 说明 HttpMessageConversionException Thrown byHttpMessageConverter
implementations when a conversion attempt fails.HttpMessageNotReadableException Thrown byHttpMessageConverter
implementations when theHttpMessageConverter.read(java.lang.Class<? extends T>, org.springframework.http.HttpInputMessage)
method fails.HttpMessageNotWritableException Thrown byHttpMessageConverter
implementations when theHttpMessageConverter.write(T, org.springframework.http.MediaType, org.springframework.http.HttpOutputMessage)
method fails.