public class InterceptorChain extends Object implements Interceptor
Constructor and Description |
---|
InterceptorChain() |
Modifier and Type | Method and Description |
---|---|
InterceptorChain |
addInterceptor(Interceptor interceptor) |
void |
afterExecute(ForestRequest request,
ForestResponse response) |
boolean |
beforeExecute(ForestRequest request) |
int |
getInterceptorSize() |
void |
onError(ForestRuntimeException ex,
ForestRequest request,
ForestResponse response)
请求失败后调用该方法
|
void |
onInvokeMethod(ForestRequest request,
ForestMethod method,
Object[] args) |
void |
onLoadCookie(ForestRequest request,
ForestCookies cookies)
在发送请求加载Cookie时调用该方法
|
void |
onProgress(ForestProgress progress)
文件上传或下载监听传输进度时调用该方法
|
void |
onSaveCookie(ForestRequest request,
ForestCookies cookies)
在请求响应成功后,需要保存Cookie时调用该方法
|
void |
onSuccess(Object data,
ForestRequest request,
ForestResponse response)
请求成功后调用该方法
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addAttribute, getAttribute, getAttribute, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInteger, getAttributeAsString, getAttributes
public InterceptorChain addInterceptor(Interceptor interceptor)
public int getInterceptorSize()
public void onInvokeMethod(ForestRequest request, ForestMethod method, Object[] args)
onInvokeMethod
in interface Interceptor
public boolean beforeExecute(ForestRequest request)
beforeExecute
in interface Interceptor
public void onSuccess(Object data, ForestRequest request, ForestResponse response)
OnSuccess
public void onError(ForestRuntimeException ex, ForestRequest request, ForestResponse response)
OnError
public void onProgress(ForestProgress progress)
OnProgress
onProgress
in interface OnProgress
onProgress
in interface Interceptor
progress
- Forest进度对象public void onLoadCookie(ForestRequest request, ForestCookies cookies)
OnLoadCookie
onLoadCookie
in interface OnLoadCookie
onLoadCookie
in interface Interceptor
request
- Forest请求对象cookies
- Cookie集合, 需要通过请求发送的Cookie都添加到该集合public void onSaveCookie(ForestRequest request, ForestCookies cookies)
OnSaveCookie
onSaveCookie
in interface OnSaveCookie
onSaveCookie
in interface Interceptor
request
- Forest请求对象cookies
- Cookie集合,通过响应返回的Cookie都从该集合获取public void afterExecute(ForestRequest request, ForestResponse response)
afterExecute
in interface Interceptor
Copyright © 2020. All rights reserved.