AbstractAutowireCapableBeanFactory.java 文件源码

java
阅读 20 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Extract a filtered set of PropertyDescriptors from the given BeanWrapper,
 * excluding ignored dependency types or properties defined on ignored dependency interfaces.
 * @param bw the BeanWrapper the bean was created with
 * @param cache whether to cache filtered PropertyDescriptors for the given bean Class
 * @return the filtered PropertyDescriptors
 * @see #isExcludedFromDependencyCheck
 * @see #filterPropertyDescriptorsForDependencyCheck(org.springframework.beans.BeanWrapper)
 */
protected PropertyDescriptor[] filterPropertyDescriptorsForDependencyCheck(BeanWrapper bw, boolean cache) {
    PropertyDescriptor[] filtered = this.filteredPropertyDescriptorsCache.get(bw.getWrappedClass());
    if (filtered == null) {
        if (cache) {
            synchronized (this.filteredPropertyDescriptorsCache) {
                filtered = this.filteredPropertyDescriptorsCache.get(bw.getWrappedClass());
                if (filtered == null) {
                    filtered = filterPropertyDescriptorsForDependencyCheck(bw);
                    this.filteredPropertyDescriptorsCache.put(bw.getWrappedClass(), filtered);
                }
            }
        }
        else {
            filtered = filterPropertyDescriptorsForDependencyCheck(bw);
        }
    }
    return filtered;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号