public interface GenericHttpMessageConverter<T>
extends org.springframework.http.converter.HttpMessageConverter<T>
HttpMessageConverter that can convert an HTTP
request into a target object of a specified generic type.org.springframework.core.ParameterizedTypeReference| Modifier and Type | Method and Description |
|---|---|
boolean |
canRead(Type type,
org.springframework.http.MediaType mediaType)
Indicates whether the given type can be read by this converter.
|
T |
read(Type type,
org.springframework.http.HttpInputMessage inputMessage)
Read an object of the given type form the given input message, and returns it.
|
boolean canRead(Type type, org.springframework.http.MediaType mediaType)
type - the type to test for readabilitymediaType - the media type to read, can be null if not specified.
Typically the value of a Content-Type header.true if readable; false otherwiseT read(Type type, org.springframework.http.HttpInputMessage inputMessage) throws IOException, org.springframework.http.converter.HttpMessageNotReadableException
type - the type of object to return. This type must have previously
been passed to the canRead method of this interface,
which must have returned true.type - the type of the target objectinputMessage - the HTTP input message to read fromIOException - in case of I/O errorsHttpMessageNotReadableException - in case of conversion errorsCopyright © 2012. All Rights Reserved.