mirror of
https://gitee.com/dromara/hutool.git
synced 2025-06-28 13:34:09 +08:00
优化PropDesc
缓存注解判断,提升性能(pr#1335@Gitee)
This commit is contained in:
parent
3ff79b3f23
commit
87a6bdeaaa
@ -13,6 +13,7 @@
|
||||
* 【core 】 重载subtractToList方法,提供isLinked选项(pr#3923@Github)
|
||||
* 【extra 】 `TemplateConfig`增加`setUseCache`方法(issue#IC3JRY@Gitee)
|
||||
* 【extra 】 `AbstractFtp`增加`rename`方法(issue#IC3PMI@Gitee)
|
||||
* 【core 】 优化`PropDesc`缓存注解判断,提升性能(pr#1335@Gitee)
|
||||
|
||||
### 🐞Bug修复
|
||||
* 【setting】 修复`Setting`autoLoad可能的加载为空的问题(issue#3919@Github)
|
||||
|
@ -70,7 +70,10 @@ public class PropDesc {
|
||||
/**
|
||||
* 在对象的所有属性设置完成后,执行初始化逻辑。
|
||||
* <p>
|
||||
* 预先计算transient关键字和@Transient注解、{@link PropIgnore}注解信息
|
||||
* 预先计算transient关键字和@Transient注解、{@link PropIgnore}注解信息<br>
|
||||
* 见:https://gitee.com/chinabugotech/hutool/pulls/1335
|
||||
*
|
||||
* @since 5.8.38
|
||||
*/
|
||||
public void initialize() {
|
||||
transientForGet = isTransientForGet();
|
||||
@ -78,6 +81,7 @@ public class PropDesc {
|
||||
ignoreGet = isIgnoreGet();
|
||||
ignoreSet = isIgnoreSet();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取字段名,如果存在Alias注解,读取注解的值作为名称
|
||||
*
|
||||
@ -370,7 +374,7 @@ public class PropDesc {
|
||||
*/
|
||||
private boolean isIgnoreSet() {
|
||||
return AnnotationUtil.hasAnnotation(this.field, PropIgnore.class)
|
||||
|| AnnotationUtil.hasAnnotation(this.setter, PropIgnore.class);
|
||||
|| AnnotationUtil.hasAnnotation(this.setter, PropIgnore.class);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -385,7 +389,7 @@ public class PropDesc {
|
||||
*/
|
||||
private boolean isIgnoreGet() {
|
||||
return AnnotationUtil.hasAnnotation(this.field, PropIgnore.class)
|
||||
|| AnnotationUtil.hasAnnotation(this.getter, PropIgnore.class);
|
||||
|| AnnotationUtil.hasAnnotation(this.getter, PropIgnore.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user