Package com.pdfgate
Class PdfGateResponseParserCallback<T>
java.lang.Object
com.pdfgate.PdfGateResponseParserCallback<T>
- Type Parameters:
T- response type produced by the parser.
- All Implemented Interfaces:
okhttp3.Callback
- Direct Known Subclasses:
PdfGateEnvelopeResponseParserCallback,PdfGateFileResponseParserCallback,PdfGateJsonObjectResponseParserCallback,PdfGateJsonResponseParserCallback
Base callback that parses HTTP responses and dispatches results to a
PdfGateCallback.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PdfGateCallback<T> Callback invoked with parsed responses or errors. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates a response parser callback. -
Method Summary
Modifier and TypeMethodDescriptionvoidonFailure(okhttp3.Call call, IOException e) voidonResponse(okhttp3.Call call, okhttp3.Response response) abstract TparseResponse(okhttp3.Response response) Parses the HTTP response into the expected payload type.
-
Field Details
-
callback
Callback invoked with parsed responses or errors.
-
-
Constructor Details
-
PdfGateResponseParserCallback
protected PdfGateResponseParserCallback()Creates a response parser callback.
-
-
Method Details
-
onFailure
- Specified by:
onFailurein interfaceokhttp3.Callback
-
onResponse
public void onResponse(@NotNull okhttp3.Call call, @NotNull okhttp3.Response response) - Specified by:
onResponsein interfaceokhttp3.Callback
-
parseResponse
Parses the HTTP response into the expected payload type.- Parameters:
response- HTTP response to parse.- Returns:
- the parsed response payload.
- Throws:
IOException- when parsing fails.
-