public abstract class**JsonCronetCallback** extends[InMemoryTransformCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html)\<JSONObject\>  
A specialization of[InMemoryTransformCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html)that interprets the response body as JSON.  

### Public Constructor Summary

|---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|   | [JsonCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/JsonCronetCallback.html#JsonCronetCallback())() |

### Public Method Summary

|-----------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [JsonCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/JsonCronetCallback.html) | [addCompletionListener](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/JsonCronetCallback.html#addCompletionListener(org.chromium.net.apihelpers.CronetRequestCompletionListener<?%20super%20org.json.JSONObject>))([CronetRequestCompletionListener](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/CronetRequestCompletionListener.html)\<? super JSONObject\> listener) Adds a completion listener. |

### Protected Method Summary

|------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| JSONObject | [transformBodyBytes](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/JsonCronetCallback.html#transformBodyBytes(org.chromium.net.UrlResponseInfo,%20byte[]))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, byte\[\] bodyBytes) Transforms (deserializes) the plain full body into a user-defined object. |

### Inherited Method Summary

From class[org.chromium.net.apihelpers.InMemoryTransformCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html)  

|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| [ImplicitFlowControlCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html) | [addCompletionListener](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#addCompletionListener(org.chromium.net.apihelpers.CronetRequestCompletionListener<?%20super%20T>))([CronetRequestCompletionListener](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/CronetRequestCompletionListener.html)\<? super T\> listener) Adds a completion listener.                                                                                                                                                                                                |
| final void                                                                                                                                                      | [onBodyChunkRead](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#onBodyChunkRead(org.chromium.net.UrlResponseInfo,%20java.nio.ByteBuffer))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, ByteBuffer bodyChunk) Invoked whenever part of the response body has been read.                                                                                                                                                                                                                                        |
| final void                                                                                                                                                      | [onCanceled](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#onCanceled(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked if request was canceled via[UrlRequest.cancel()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#cancel()).                                                                                                                                                                                |
| final void                                                                                                                                                      | [onFailed](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#onFailed(org.chromium.net.UrlResponseInfo,%20org.chromium.net.CronetException))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info,[CronetException](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/CronetException.html)exception) Invoked if request failed for any reason after[UrlRequest.start()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#start()). |
| final void                                                                                                                                                      | [onResponseStarted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#onResponseStarted(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when the final set of headers, after all redirects, is received.                                                                                                                                                                                                                                                                  |
| final void                                                                                                                                                      | [onSucceeded](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#onSucceeded(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when request is completed successfully.                                                                                                                                                                                                                                                                                                       |
| abstract JSONObject                                                                                                                                             | [transformBodyBytes](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/InMemoryTransformCronetCallback.html#transformBodyBytes(org.chromium.net.UrlResponseInfo,%20byte[]))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, byte\[\] bodyBytes) Transforms (deserializes) the plain full body into a user-defined object.                                                                                                                                                                                                                                 |

From class[org.chromium.net.apihelpers.ImplicitFlowControlCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html)  

|------------------| |
| abstract void    | [onBodyChunkRead](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onBodyChunkRead(org.chromium.net.UrlResponseInfo,%20java.nio.ByteBuffer))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, ByteBuffer bodyChunk) Invoked whenever part of the response body has been read.                                                                                                                                                                                                                                                                                                                                                                                             |
| abstract void    | [onCanceled](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onCanceled(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked if request was canceled via[UrlRequest.cancel()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#cancel()).                                                                                                                                                                                                                                                                                                                                     |
| final void       | [onCanceled](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onCanceled(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked if request was canceled via[UrlRequest.cancel()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#cancel()).                                                                                                                                                                            |
| final void       | [onFailed](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onFailed(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20org.chromium.net.CronetException))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info,[CronetException](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/CronetException.html)error) Invoked if request failed for any reason after[UrlRequest.start()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#start()). |
| abstract void    | [onFailed](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onFailed(org.chromium.net.UrlResponseInfo,%20org.chromium.net.CronetException))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info,[CronetException](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/CronetException.html)exception) Invoked if request failed for any reason after[UrlRequest.start()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#start()).                                                                                                                                                      |
| final void       | [onReadCompleted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onReadCompleted(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20java.nio.ByteBuffer))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, ByteBuffer byteBuffer) Invoked whenever part of the response body has been read.                                                                                                                                                                                                                                   |
| final void       | [onRedirectReceived](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onRedirectReceived(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20java.lang.String))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, String newLocationUrl) Invoked whenever a redirect is encountered.                                                                                                                                                                                                                                              |
| abstract void    | [onResponseStarted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onResponseStarted(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when the final set of headers, after all redirects, is received.                                                                                                                                                                                                                                                                                                                                                                                                                       |
| final void       | [onResponseStarted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onResponseStarted(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when the final set of headers, after all redirects, is received.                                                                                                                                                                                                                                                              |
| final void       | [onSucceeded](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onSucceeded(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when request is completed successfully.                                                                                                                                                                                                                                                                                                   |
| abstract void    | [onSucceeded](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#onSucceeded(org.chromium.net.UrlResponseInfo))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when request is completed successfully.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| abstract boolean | [shouldFollowRedirect](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/ImplicitFlowControlCallback.html#shouldFollowRedirect(org.chromium.net.UrlResponseInfo,%20java.lang.String))([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, String newLocationUrl) Invoked whenever a redirect is encountered.                                                                                                                                                                                                                                                                                                                                                                                                   |

From class[org.chromium.net.UrlRequest.Callback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html)  

|---------------| |
| void          | [onCanceled](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onCanceled(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked if request was canceled via[UrlRequest.cancel()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#cancel()).                                                                                                                                                                            |
| abstract void | [onFailed](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onFailed(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20org.chromium.net.CronetException))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info,[CronetException](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/CronetException.html)error) Invoked if request failed for any reason after[UrlRequest.start()](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html#start()). |
| abstract void | [onReadCompleted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onReadCompleted(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20java.nio.ByteBuffer))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, ByteBuffer byteBuffer) Invoked whenever part of the response body has been read.                                                                                                                                                                                                                                   |
| abstract void | [onRedirectReceived](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onRedirectReceived(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo,%20java.lang.String))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, String newLocationUrl) Invoked whenever a redirect is encountered.                                                                                                                                                                                                                                              |
| abstract void | [onResponseStarted](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onResponseStarted(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when the final set of headers, after all redirects, is received.                                                                                                                                                                                                                                                              |
| abstract void | [onSucceeded](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.Callback.html#onSucceeded(org.chromium.net.UrlRequest,%20org.chromium.net.UrlResponseInfo))([UrlRequest](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlRequest.html)request,[UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info) Invoked when request is completed successfully.                                                                                                                                                                                                                                                                                                   |

From class java.lang.Object  

|------------------|---------------------------|
| Object           | clone()                   |
| boolean          | equals(Object arg0)       |
| void             | finalize()                |
| final Class\<?\> | getClass()                |
| int              | hashCode()                |
| final void       | notify()                  |
| final void       | notifyAll()               |
| String           | toString()                |
| final void       | wait(long arg0, int arg1) |
| final void       | wait(long arg0)           |
| final void       | wait()                    |

## Public Constructors

#### public**JsonCronetCallback**()

<br />

## Public Methods

#### public[JsonCronetCallback](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/JsonCronetCallback.html)**addCompletionListener**([CronetRequestCompletionListener](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/apihelpers/CronetRequestCompletionListener.html)\<? super JSONObject\> listener)

Adds a completion listener. All listeners are informed when the request reaches a terminal state, in order of addition. If a listener is added multiple times, it will only be called once according to the first time it was added.  

##### Parameters

| listener |   |
|----------|---|

## Protected Methods

#### protected JSONObject**transformBodyBytes**([UrlResponseInfo](https://developer.android.com/develop/connectivity/cronet/reference/org/chromium/net/UrlResponseInfo.html)info, byte\[\] bodyBytes)

Transforms (deserializes) the plain full body into a user-defined object.

It is assumed that the implementing classes handle edge cases (such as empty and malformed bodies) appropriately. Cronet doesn't inspects the objects and passes them (or any exceptions) along to the issuer of the request.  

##### Parameters

|   info    |   |
| bodyBytes |   |
|-----------|---|