Package org.springframework.web.client
Class HttpMessageConverterExtractor<T>
- java.lang.Object
- org.springframework.web.client.HttpMessageConverterExtractor<T>
- All Implemented Interfaces:
ResponseExtractor<T>
public class HttpMessageConverterExtractor<T> extends Object implements ResponseExtractor<T>
Response extractor that uses the given entity converters to convert the response into a typeT.- Since:
- 3.0
- Author:
- Arjen Poutsma
- See Also:
RestTemplate
Constructor Summary
Constructors Constructor Description HttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters)Create a new instance of theHttpMessageConverterExtractorwith the given response type and message converters.HttpMessageConverterExtractor(Type responseType, List<HttpMessageConverter<?>> messageConverters)Creates a new instance of theHttpMessageConverterExtractorwith the given response type and message converters.
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TextractData(ClientHttpResponse response)Extract data from the givenClientHttpResponseand return it.
Constructor Detail
HttpMessageConverterExtractor
public HttpMessageConverterExtractor(Class<T> responseType, List<HttpMessageConverter<?>> messageConverters)
Create a new instance of theHttpMessageConverterExtractorwith the given response type and message converters. The given converters must support the response type.
HttpMessageConverterExtractor
public HttpMessageConverterExtractor(Type responseType, List<HttpMessageConverter<?>> messageConverters)
Creates a new instance of theHttpMessageConverterExtractorwith the given response type and message converters. The given converters must support the response type.
Method Detail
extractData
public T extractData(ClientHttpResponse response) throws IOException
Description copied from interface:ResponseExtractorExtract data from the givenClientHttpResponseand return it.- Specified by:
extractDatain interfaceResponseExtractor<T>- Parameters:
response- the HTTP response- Returns:
- the extracted data
- Throws:
IOException- in case of I/O errors