类 GsonRequest<Q,R>
java.lang.Object
com.android.volley.Request<R>
net.apexes.commons.volley.GsonRequest<Q,R>
- 类型参数:
Q- Request数据类型R- Response数据类型
- 所有已实现的接口:
Comparable<Request<R>>
- 作者:
- HeDYn
-
嵌套类概要
嵌套类从类继承的嵌套类/接口 com.android.volley.Request
Request.Method, Request.Priority -
字段概要
字段 -
构造器概要
构造器构造器说明GsonRequest(String url, Q requestObject, Type responseType, Response.Listener<R> listener, Response.ErrorListener errorListener) GsonRequest(String url, Q requestObject, Type responseType, com.google.gson.Gson gson, Response.Listener<R> listener, Response.ErrorListener errorListener) -
方法概要
修饰符和类型方法说明protected voiddeliverResponse(R response) Subclasses must implement this to perform delivery of the parsed response to their listeners.byte[]getBody()Returns the raw POST or PUT body to be sent.Returns the content type of the POST or PUT body.parseNetworkResponse(NetworkResponse response) Subclasses must implement this to parse the raw network response and return an appropriate response type.voidsetResponseProcessor(GsonRequest.ResponseProcessor<R> processor) protected RtoResponseValue(String json, Type responseType) 从类继承的方法 com.android.volley.Request
addMarker, cancel, compareTo, deliverError, getCacheEntry, getCacheKey, getErrorListener, getHeaders, getMethod, getParams, getParamsEncoding, getPostBody, getPostBodyContentType, getPostParams, getPostParamsEncoding, getPriority, getRetryPolicy, getSequence, getTag, getTimeoutMs, getTrafficStatsTag, getUrl, hasHadResponseDelivered, isCanceled, markDelivered, parseNetworkError, setCacheEntry, setRequestQueue, setRetryPolicy, setSequence, setShouldCache, setTag, shouldCache, toString
-
字段详细资料
-
构造器详细资料
-
GsonRequest
public GsonRequest(String url, Q requestObject, Type responseType, Response.Listener<R> listener, Response.ErrorListener errorListener) - 参数:
url-requestObject- 要POST的数据responseType- Response数据要转成的对象类型listener-errorListener-
-
GsonRequest
public GsonRequest(String url, Q requestObject, Type responseType, com.google.gson.Gson gson, Response.Listener<R> listener, Response.ErrorListener errorListener) - 参数:
url-requestObject- 要POST的数据responseType- Response数据要转成的对象类型gson-listener-errorListener-
-
-
方法详细资料
-
getBodyContentType
从类复制的说明:RequestReturns the content type of the POST or PUT body.- 覆盖:
getBodyContentType在类中Request<R>
-
getBody
从类复制的说明:RequestReturns the raw POST or PUT body to be sent.By default, the body consists of the request parameters in application/x-www-form-urlencoded format. When overriding this method, consider overriding
Request.getBodyContentType()as well to match the new body format.- 覆盖:
getBody在类中Request<R>- 抛出:
AuthFailureError- in the event of auth failure
-
deliverResponse
从类复制的说明:RequestSubclasses must implement this to perform delivery of the parsed response to their listeners. The given response is guaranteed to be non-null; responses that fail to parse are not delivered.- 指定者:
deliverResponse在类中Request<R>- 参数:
response- The parsed response returned byRequest.parseNetworkResponse(NetworkResponse)
-
parseNetworkResponse
从类复制的说明:RequestSubclasses 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.- 指定者:
parseNetworkResponse在类中Request<R>- 参数:
response- Response from the network- 返回:
- The parsed response, or null in the case of an error
-
toResponseValue
- 抛出:
Exception
-
setResponseProcessor
-