public abstract class AbstractBodyBuilder<T> extends Object implements BodyBuilder<T>
Constructor and Description |
---|
AbstractBodyBuilder() |
Modifier and Type | Method and Description |
---|---|
void |
buildBody(T httpRequest,
ForestRequest request,
LifeCycleHandler lifeCycleHandler)
构建请求体
|
protected void |
processFormArrayItem(List<RequestNameValue> newNameValueList,
ForestConfiguration configuration,
String name,
Object array,
int target)
处理Form表单中的数组项
|
protected void |
processFormCollectionItem(List<RequestNameValue> newNameValueList,
ForestConfiguration configuration,
String name,
Collection collection,
int target)
处理Form表单中的集合项
|
protected void |
processFormItem(List<RequestNameValue> newNameValueList,
ForestConfiguration configuration,
String name,
Object value,
int target)
处理Form表单中的项
|
protected void |
processFormMapItem(List<RequestNameValue> newNameValueList,
ForestConfiguration configuration,
String name,
Map map,
int target)
处理Form表单中的Map项
|
protected List<RequestNameValue> |
processFromNameValueList(List<RequestNameValue> nameValueList,
ForestConfiguration configuration)
处理Form表单中的键值对列表
|
protected abstract void |
setFileBody(T httpReq,
ForestRequest request,
String charset,
String contentType,
List<RequestNameValue> nameValueList,
List<ForestMultipart> multiparts,
LifeCycleHandler lifeCycleHandler)
设置文件请求体
|
protected abstract void |
setFormBody(T httpReq,
ForestRequest request,
String charset,
String contentType,
List<RequestNameValue> nameValueList)
设置表单请求体
|
protected abstract void |
setStringBody(T httpReq,
String text,
String charset,
String contentType,
boolean mergeCharset)
设置字符串请求体
|
public void buildBody(T httpRequest, ForestRequest request, LifeCycleHandler lifeCycleHandler)
buildBody
in interface BodyBuilder<T>
httpRequest
- 后端http请求对象request
- Forest请求对象lifeCycleHandler
- 生命周期处理器protected void processFormCollectionItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Collection collection, int target)
newNameValueList
- 键值对列表configuration
- Forest配置name
- 表单项目名collection
- 集合对象target
- 请求目标位置protected void processFormArrayItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Object array, int target)
newNameValueList
- 键值对列表configuration
- Forest配置name
- 表单项目名array
- 数组target
- 请求目标位置protected void processFormMapItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Map map, int target)
newNameValueList
- 键值对列表configuration
- Forest配置name
- 表单项目名map
- Map对象target
- 请求目标位置protected void processFormItem(List<RequestNameValue> newNameValueList, ForestConfiguration configuration, String name, Object value, int target)
newNameValueList
- 键值对列表configuration
- Forest配置name
- 表单项目名value
- 表单项目值target
- 请求目标位置protected List<RequestNameValue> processFromNameValueList(List<RequestNameValue> nameValueList, ForestConfiguration configuration)
nameValueList
- 键值对列表protected abstract void setStringBody(T httpReq, String text, String charset, String contentType, boolean mergeCharset)
httpReq
- 后端请求对象text
- 字符串文本charset
- 字符集contentType
- 数据类型mergeCharset
- 是否合并字符集protected abstract void setFormBody(T httpReq, ForestRequest request, String charset, String contentType, List<RequestNameValue> nameValueList)
httpReq
- 后端请求对象request
- Forest请求对象charset
- 字符集contentType
- 数据类型nameValueList
- 键值对列表protected abstract void setFileBody(T httpReq, ForestRequest request, String charset, String contentType, List<RequestNameValue> nameValueList, List<ForestMultipart> multiparts, LifeCycleHandler lifeCycleHandler)
httpReq
- 后端请求对象request
- Forest请求对象charset
- 字符集contentType
- 数据类型nameValueList
- 键值对列表multiparts
- MultipartslifeCycleHandler
- 生命周期处理器Copyright © 2020. All rights reserved.