|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Objectcom.baidu.sapi2.http.AsyncHttpResponseHandler
com.baidu.sapi2.http.JsonHttpResponseHandler
public class JsonHttpResponseHandler
Used to intercept and handle the responses from requests made using
AsyncHttpClient
, with automatic parsing into a JSONObject
or
JSONArray
.
This class is designed to be passed to get, post, put and delete requests
with the onSuccess(JSONObject)
or onSuccess(JSONArray)
methods anonymously overridden.
Additionally, you can override the other event methods from the parent class.
字段摘要 | |
---|---|
protected static int |
SUCCESS_JSON_MESSAGE
|
从类 com.baidu.sapi2.http.AsyncHttpResponseHandler 继承的字段 |
---|
FAILURE_MESSAGE, FINISH_MESSAGE, START_MESSAGE, SUCCESS_MESSAGE |
构造方法摘要 | |
---|---|
JsonHttpResponseHandler()
|
方法摘要 | |
---|---|
protected void |
handleFailureMessage(Throwable e,
String responseBody)
|
protected void |
handleMessage(android.os.Message msg)
|
protected void |
handleSuccessJsonMessage(int statusCode,
Object jsonResponse)
|
void |
onFailure(Throwable e,
org.json.JSONArray errorResponse)
|
void |
onFailure(Throwable e,
org.json.JSONObject errorResponse)
|
void |
onSuccess(int statusCode,
org.json.JSONArray response)
Fired when a request returns successfully and contains a json array at the base of the response string. |
void |
onSuccess(int statusCode,
org.json.JSONObject response)
Fired when a request returns successfully and contains a json object at the base of the response string. |
void |
onSuccess(org.json.JSONArray response)
Fired when a request returns successfully and contains a json array at the base of the response string. |
void |
onSuccess(org.json.JSONObject response)
Fired when a request returns successfully and contains a json object at the base of the response string. |
protected Object |
parseResponse(String responseBody)
|
protected void |
sendSuccessMessage(int statusCode,
String responseBody)
|
从类 com.baidu.sapi2.http.AsyncHttpResponseHandler 继承的方法 |
---|
handleSuccessMessage, obtainMessage, onFailure, onFailure, onFinish, onStart, onSuccess, onSuccess, sendFailureMessage, sendFailureMessage, sendFinishMessage, sendMessage, sendStartMessage |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
protected static final int SUCCESS_JSON_MESSAGE
构造方法详细信息 |
---|
public JsonHttpResponseHandler()
方法详细信息 |
---|
public void onSuccess(org.json.JSONObject response)
response
- the parsed json object found in the server response (if
any)public void onSuccess(org.json.JSONArray response)
response
- the parsed json array found in the server response (if
any)public void onSuccess(int statusCode, org.json.JSONObject response)
statusCode
- the status code of the responseresponse
- the parsed json object found in the server response (if
any)public void onSuccess(int statusCode, org.json.JSONArray response)
statusCode
- the status code of the responseresponse
- the parsed json array found in the server response (if
any)public void onFailure(Throwable e, org.json.JSONObject errorResponse)
public void onFailure(Throwable e, org.json.JSONArray errorResponse)
protected void sendSuccessMessage(int statusCode, String responseBody)
AsyncHttpResponseHandler
中的 sendSuccessMessage
protected void handleMessage(android.os.Message msg)
AsyncHttpResponseHandler
中的 handleMessage
protected void handleSuccessJsonMessage(int statusCode, Object jsonResponse)
protected Object parseResponse(String responseBody) throws org.json.JSONException
org.json.JSONException
protected void handleFailureMessage(Throwable e, String responseBody)
AsyncHttpResponseHandler
中的 handleFailureMessage
|
||||||||||
上一个类 下一个类 | 框架 无框架 | |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |