mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
fix doc
This commit is contained in:
parent
6acf0854d8
commit
08da23b3d4
@ -17,6 +17,7 @@ public enum GlobalInterceptor {
|
||||
* 设置拦截器,用于在请求前重新编辑请求
|
||||
*
|
||||
* @param interceptor 拦截器实现
|
||||
* @return this
|
||||
*/
|
||||
synchronized public GlobalInterceptor addRequestInterceptor(HttpInterceptor<HttpRequest> interceptor) {
|
||||
this.requestInterceptors.addChain(interceptor);
|
||||
@ -27,6 +28,7 @@ public enum GlobalInterceptor {
|
||||
* 设置拦截器,用于在响应读取后完成编辑或读取
|
||||
*
|
||||
* @param interceptor 拦截器实现
|
||||
* @return this
|
||||
*/
|
||||
synchronized public GlobalInterceptor addResponseInterceptor(HttpInterceptor<HttpResponse> interceptor) {
|
||||
this.responseInterceptors.addChain(interceptor);
|
||||
|
@ -244,6 +244,7 @@ public class HttpConfig {
|
||||
* 如果服务端未遵循这个规范或响应没有正常结束,会报EOF异常,此选项用于是否忽略这个异常。
|
||||
*
|
||||
* @param ignoreEOFError 是否忽略响应读取时可能的EOF异常。
|
||||
* @return this
|
||||
* @since 5.7.20
|
||||
*/
|
||||
public HttpConfig setIgnoreEOFError(boolean ignoreEOFError) {
|
||||
@ -257,6 +258,7 @@ public class HttpConfig {
|
||||
* 按照RFC3986规范,在发送请求时,全部编码之。如果为{@code false},则不会解码已经编码的内容,在请求时只编码需要编码的部分。
|
||||
*
|
||||
* @param decodeUrl 是否忽略解码URL
|
||||
* @return this
|
||||
*/
|
||||
public HttpConfig setDecodeUrl(boolean decodeUrl) {
|
||||
this.decodeUrl = decodeUrl;
|
||||
@ -267,6 +269,7 @@ public class HttpConfig {
|
||||
* 设置拦截器,用于在请求前重新编辑请求
|
||||
*
|
||||
* @param interceptor 拦截器实现
|
||||
* @return this
|
||||
*/
|
||||
public HttpConfig addRequestInterceptor(HttpInterceptor<HttpRequest> interceptor) {
|
||||
this.requestInterceptors.addChain(interceptor);
|
||||
|
@ -369,9 +369,10 @@ public class JSONObject extends MapWrapper<String, Object> implements JSON, JSON
|
||||
/**
|
||||
* 设置键值对到JSONObject中,在忽略null模式下,如果值为{@code null},将此键移除
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值对象. 可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作,{@code null}表示不过滤
|
||||
* @param key 键
|
||||
* @param value 值对象. 可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作,{@code null}表示不过滤
|
||||
* @param checkDuplicate 是否检查重复键,如果为{@code true},则出现重复键时抛出{@link JSONException}异常
|
||||
* @return this.
|
||||
* @throws JSONException 值是无穷数字抛出此异常
|
||||
* @since 5.8.0
|
||||
@ -388,7 +389,7 @@ public class JSONObject extends MapWrapper<String, Object> implements JSON, JSON
|
||||
// 使用修改后的键值对
|
||||
key = pair.getKey();
|
||||
value = pair.getValue();
|
||||
}else{
|
||||
} else {
|
||||
// 键值对被过滤
|
||||
return this;
|
||||
}
|
||||
@ -399,7 +400,7 @@ public class JSONObject extends MapWrapper<String, Object> implements JSON, JSON
|
||||
// 忽略值模式下如果值为空清除key
|
||||
this.remove(key);
|
||||
} else {
|
||||
if(checkDuplicate && containsKey(key)){
|
||||
if (checkDuplicate && containsKey(key)) {
|
||||
throw new JSONException("Duplicate key \"{}\"", key);
|
||||
}
|
||||
|
||||
@ -423,9 +424,10 @@ public class JSONObject extends MapWrapper<String, Object> implements JSON, JSON
|
||||
/**
|
||||
* 一次性Put 键值对,如果key已经存在抛出异常,如果键值中有null值,忽略
|
||||
*
|
||||
* @param key 键
|
||||
* @param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
|
||||
* @return this.
|
||||
* @param key 键
|
||||
* @param value 值对象,可以是以下类型: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONNull.NULL.
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作,{@code null}表示不过滤
|
||||
* @return this
|
||||
* @throws JSONException 值是无穷数字、键重复抛出异常
|
||||
* @since 5.8.0
|
||||
*/
|
||||
|
@ -34,11 +34,12 @@ public class JSONParser {
|
||||
}
|
||||
|
||||
// region parseTo
|
||||
|
||||
/**
|
||||
* 解析{@link JSONTokener}中的字符到目标的{@link JSONObject}中
|
||||
*
|
||||
* @param jsonObject {@link JSONObject}
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作,{@code null}表示不过滤
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对键值对的过滤和修改操作,{@code null}表示不过滤
|
||||
*/
|
||||
public void parseTo(JSONObject jsonObject, Filter<MutablePair<String, Object>> filter) {
|
||||
final JSONTokener tokener = this.tokener;
|
||||
@ -91,7 +92,8 @@ public class JSONParser {
|
||||
/**
|
||||
* 解析JSON字符串到{@link JSONArray}中
|
||||
*
|
||||
* @param jsonArray {@link JSONArray}
|
||||
* @param jsonArray {@link JSONArray
|
||||
* @param filter 键值对过滤编辑器,可以通过实现此接口,完成解析前对值的过滤和修改操作,{@code null}表示不过滤
|
||||
*/
|
||||
public void parseTo(JSONArray jsonArray, Filter<Mutable<Object>> filter) {
|
||||
final JSONTokener x = this.tokener;
|
||||
|
Loading…
Reference in New Issue
Block a user