Class OkHttpValidatingShapeTreeInterceptor
java.lang.Object
com.janeirodigital.shapetrees.client.okhttp.OkHttpValidatingShapeTreeInterceptor
- All Implemented Interfaces:
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 -
Method Summary
Modifier and TypeMethodDescriptionokhttp3.Response
intercept
(okhttp3.Interceptor.Chain chain) Key method on Interceptor class which is implemented on an intercepted HTTP call.
-
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 interfaceokhttp3.Interceptor
- Parameters:
chain
- OkHttp request chain- Returns:
- Response to return back to intercepting chain
- Throws:
IOException
- IOException thrown from chain.proceed
-