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

public abstract class PdfGateResponseParserCallback<T> extends Object implements okhttp3.Callback
Base callback that parses HTTP responses and dispatches results to a PdfGateCallback.
  • Field Details

    • callback

      protected PdfGateCallback<T> callback
      Callback invoked with parsed responses or errors.
  • Constructor Details

    • PdfGateResponseParserCallback

      protected PdfGateResponseParserCallback()
      Creates a response parser callback.
  • Method Details

    • onFailure

      public void onFailure(@NotNull okhttp3.Call call, @NotNull IOException e)
      Specified by:
      onFailure in interface okhttp3.Callback
    • onResponse

      public void onResponse(@NotNull okhttp3.Call call, @NotNull okhttp3.Response response)
      Specified by:
      onResponse in interface okhttp3.Callback
    • parseResponse

      public abstract T parseResponse(okhttp3.Response response) throws IOException
      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.