feign.codec
Interface IncrementalDecoder<I,T>

Type Parameters:
I - input that can be derived from Response.Body.
T - widest type an instance of this can decode.
All Known Subinterfaces:
IncrementalDecoder.TextStream<T>
All Known Implementing Classes:
StringIncrementalDecoder

public interface IncrementalDecoder<I,T>

Decodes an HTTP response incrementally into an IncrementalCallback via a series of onNext calls.

Invoked when Response.status() is in the 2xx range.


Nested Class Summary
static interface IncrementalDecoder.TextStream<T>
          Used for text-based apis, follows decode(Object, java.lang.reflect.Type, IncrementalCallback) semantics, applied to inputs of type Reader.
 
Method Summary
 void decode(I input, java.lang.reflect.Type type, IncrementalCallback<? super T> incrementalCallback)
          Implement this to decode a resource to an object into a single object.
 

Method Detail

decode

void decode(I input,
            java.lang.reflect.Type type,
            IncrementalCallback<? super T> incrementalCallback)
            throws java.io.IOException,
                   DecodeException,
                   FeignException
Implement this to decode a resource to an object into a single object. If you need to wrap exceptions, please do so via DecodeException.
Do not call onSuccess or onFailure.

Parameters:
input - if Closeable, no need to close this, as the caller manages resources.
type - type parameter of IncrementalCallback.onNext(T).
incrementalCallback - call onNext each time an object of type is decoded from the response.
Throws:
java.io.IOException - will be propagated safely to the caller.
DecodeException - when decoding failed due to a checked exception besides IOException.
FeignException - when decoding succeeds, but conveys the operation failed.