Class OkHttpValidatingShapeTreeInterceptor

java.lang.Object
com.janeirodigital.shapetrees.client.okhttp.OkHttpValidatingShapeTreeInterceptor
All Implemented Interfaces:
okhttp3.Interceptor

public class OkHttpValidatingShapeTreeInterceptor extends Object implements okhttp3.Interceptor
Interceptor used for client-side validation
  • Nested Class Summary

    Nested classes/interfaces inherited from interface okhttp3.Interceptor

    okhttp3.Interceptor.Chain, okhttp3.Interceptor.Companion
  • Field Summary

    Fields inherited from interface okhttp3.Interceptor

    Companion
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    okhttp3.Response
    intercept(okhttp3.Interceptor.Chain chain)
    Key method on Interceptor class which is implemented on an intercepted HTTP call.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OkHttpValidatingShapeTreeInterceptor

      public OkHttpValidatingShapeTreeInterceptor()
  • Method Details

    • intercept

      @NotNull public okhttp3.Response intercept(@NotNull okhttp3.Interceptor.Chain chain) throws IOException
      Key method on Interceptor class which is implemented on an intercepted HTTP call. Responsible for initializing a shape tree validation handler based on the HTTP method that was intercepted. DocumentResponse is used to determine whether an artificial response from the validation library should be returned or if the original request should be passed through to the 'real' server.
      Specified by:
      intercept in interface okhttp3.Interceptor
      Parameters:
      chain - OkHttp request chain
      Returns:
      Response to return back to intercepting chain
      Throws:
      IOException - IOException thrown from chain.proceed