Top Description Methods
org.springframework.web.client

public Interface ResponseExtractor<T>

Known Direct Implementers
org.springframework.web.client.RestTemplate.ResponseEntityResponseExtractor, org.springframework.web.client.RestTemplate.HeadersExtractor, org.springframework.web.client.HttpMessageConverterExtractor
Annotations
@FunctionalInterface
Type Parameters
<T>
the data type
Imports
java.io.IOException, java.lang.reflect.Type, org.springframework.http.client.ClientHttpResponse, org.springframework.lang.Nullable

Generic callback interface used by RestTemplate's retrieval methods. Implementations of this interface perform the actual work of extracting data from a ClientHttpResponse, but don't need to worry about exception handling or closing resources.

Used internally by the RestTemplate, but also useful for application code. There is one available factory method, see RestTemplate#responseEntityExtractor(Type).

Author
Arjen Poutsma
Since
3.0
See Also
RestTemplate#execute

Method Summary

Modifier and TypeMethod and Description
public T

Returns:

the extracted data
extractData
(ClientHttpResponse
the HTTP response
response
)

Extract data from the given ClientHttpResponse and return it.

Method Detail

extractDataback to summary
public T extractData(ClientHttpResponse response) throws IOException

Extract data from the given ClientHttpResponse and return it.

Parameters
response:ClientHttpResponse

the HTTP response

Returns:T

the extracted data

Annotations
@Nullable
Exceptions
IOException:
in case of I/O errors