mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
!1051 [bug修复] 修复因使用反射读取JSON自定义类型导致性能下降为原来1/3的问题 by SHA-1: 5b2d2050d2
Merge pull request !1051 from 周鹏/v5-master
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package cn.hutool.json;
|
||||
|
||||
import cn.hutool.core.bean.BeanPath;
|
||||
import cn.hutool.core.bean.copier.IJSONTypeConverter;
|
||||
import cn.hutool.core.lang.TypeReference;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -13,7 +14,7 @@ import java.lang.reflect.Type;
|
||||
*
|
||||
* @author Looly
|
||||
*/
|
||||
public interface JSON extends Cloneable, Serializable {
|
||||
public interface JSON extends Cloneable, Serializable, IJSONTypeConverter {
|
||||
|
||||
/**
|
||||
* 获取JSON配置
|
||||
@@ -177,7 +178,7 @@ public interface JSON extends Cloneable, Serializable {
|
||||
* @since 3.0.8
|
||||
*/
|
||||
default <T> T toBean(Type type) {
|
||||
return JSONConverter.jsonConvert(type, this, getConfig());
|
||||
return toBean(type, getConfig().isIgnoreError());
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user