com.duowan.mobile.netroid.request
Class JsonArrayRequest

java.lang.Object
  extended by com.duowan.mobile.netroid.Request<T>
      extended by com.duowan.mobile.netroid.request.JsonRequest<org.json.JSONArray>
          extended by com.duowan.mobile.netroid.request.JsonArrayRequest
All Implemented Interfaces:
java.lang.Comparable<Request<org.json.JSONArray>>

public class JsonArrayRequest
extends JsonRequest<org.json.JSONArray>

A request for retrieving a JSONArray response body at a given URL.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.duowan.mobile.netroid.Request
Request.Method, Request.Priority
 
Constructor Summary
JsonArrayRequest(java.lang.String url, Listener<org.json.JSONArray> listener)
          Creates a new request.
 
Method Summary
protected  Response<org.json.JSONArray> parseNetworkResponse(NetworkResponse response)
          Subclasses must implement this to parse the raw network response and return an appropriate response type.
 
Methods inherited from class com.duowan.mobile.netroid.request.JsonRequest
getBody, getBodyContentType
 
Methods inherited from class com.duowan.mobile.netroid.Request
addHeader, addMarker, cancel, compareTo, deliverCancel, deliverDownloadProgress, deliverError, deliverFinish, deliverNetworking, deliverPreExecute, deliverRetry, deliverSuccess, deliverUsedCache, finish, getCacheExpireTime, getCacheKey, getHeaders, getMethod, getParams, getParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getUrl, handleResponse, hasHadResponseDelivered, isCanceled, isForceUpdate, markDelivered, parseNetworkError, perform, prepare, removeHeader, setCacheExpireTime, setForceUpdate, setListener, setRequestQueue, setRetryPolicy, setSequence, setTag, shouldCache, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsonArrayRequest

public JsonArrayRequest(java.lang.String url,
                        Listener<org.json.JSONArray> listener)
Creates a new request.

Parameters:
url - URL to fetch the JSON from
listener - Listener to receive the JSON response or error message
Method Detail

parseNetworkResponse

protected Response<org.json.JSONArray> parseNetworkResponse(NetworkResponse response)
Description copied from class: Request
Subclasses must implement this to parse the raw network response and return an appropriate response type. This method will be called from a worker thread. The response will not be delivered if you return null.

Specified by:
parseNetworkResponse in class JsonRequest<org.json.JSONArray>
Parameters:
response - Response from the network
Returns:
The parsed response, or null in the case of an error