当前位置: 首页>>代码示例>>Java>>正文


Java ConfigurableListableBeanFactory.containsBeanDefinition方法代码示例

本文整理汇总了Java中org.springframework.beans.factory.config.ConfigurableListableBeanFactory.containsBeanDefinition方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableListableBeanFactory.containsBeanDefinition方法的具体用法?Java ConfigurableListableBeanFactory.containsBeanDefinition怎么用?Java ConfigurableListableBeanFactory.containsBeanDefinition使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.beans.factory.config.ConfigurableListableBeanFactory的用法示例。


在下文中一共展示了ConfigurableListableBeanFactory.containsBeanDefinition方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findBeanDefinition

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; //导入方法依赖的package包/类
private BeanDefinition findBeanDefinition(ConfigurableListableBeanFactory beanFactory,
                                          String beanName, boolean considerHierarchy) {
    if (beanFactory.containsBeanDefinition(beanName)) {
        return beanFactory.getBeanDefinition(beanName);
    }
    if (considerHierarchy && beanFactory.getParentBeanFactory() instanceof ConfigurableListableBeanFactory) {
        return findBeanDefinition(((ConfigurableListableBeanFactory) beanFactory.getParentBeanFactory()), beanName, considerHierarchy);
    }
    return null;
}
 
开发者ID:drtrang,项目名称:spring-boot-autoconfigure,代码行数:11,代码来源:OnBeansCondition.java

示例2: isLazy

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; //导入方法依赖的package包/类
private boolean isLazy(ConfigurableListableBeanFactory beanFactory, String beanName) {
	String name = (beanName.startsWith(BeanFactory.FACTORY_BEAN_PREFIX) ? beanName.substring(1) : beanName);
	if (beanFactory.containsBeanDefinition(name)) {
		return beanFactory.getBeanDefinition(name).isLazyInit();
	}
	return false;
}
 
开发者ID:eclipse,项目名称:gemini.blueprint,代码行数:8,代码来源:MandatoryImporterDependencyFactory.java

示例3: shouldSkip

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; //导入方法依赖的package包/类
/**
 * Check whether the given bean definition is not subject to the annotation-based
 * required property check as performed by this post-processor.
 * <p>The default implementations check for the presence of the
 * {@link #SKIP_REQUIRED_CHECK_ATTRIBUTE} attribute in the bean definition, if any.
 * It also suggests skipping in case of a bean definition with a "factory-bean"
 * reference set, assuming that instance-based factories pre-populate the bean.
 * @param beanFactory the BeanFactory to check against
 * @param beanName the name of the bean to check against
 * @return {@code true} to skip the bean; {@code false} to process it
 */
protected boolean shouldSkip(ConfigurableListableBeanFactory beanFactory, String beanName) {
	if (beanFactory == null || !beanFactory.containsBeanDefinition(beanName)) {
		return false;
	}
	BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName);
	if (beanDefinition.getFactoryBeanName() != null) {
		return true;
	}
	Object value = beanDefinition.getAttribute(SKIP_REQUIRED_CHECK_ATTRIBUTE);
	return (value != null && (Boolean.TRUE.equals(value) || Boolean.valueOf(value.toString())));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:23,代码来源:RequiredAnnotationBeanPostProcessor.java

示例4: getResolvedDecoratedDefinition

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; //导入方法依赖的package包/类
protected RootBeanDefinition getResolvedDecoratedDefinition(RootBeanDefinition rbd) {
	BeanDefinitionHolder decDef = rbd.getDecoratedDefinition();
	if (decDef != null && this.beanFactory instanceof ConfigurableListableBeanFactory) {
		ConfigurableListableBeanFactory clbf = (ConfigurableListableBeanFactory) this.beanFactory;
		if (clbf.containsBeanDefinition(decDef.getBeanName())) {
			BeanDefinition dbd = clbf.getMergedBeanDefinition(decDef.getBeanName());
			if (dbd instanceof RootBeanDefinition) {
				return (RootBeanDefinition) dbd;
			}
		}
	}
	return null;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:14,代码来源:GenericTypeAwareAutowireCandidateResolver.java

示例5: shouldProxyTargetClass

import org.springframework.beans.factory.config.ConfigurableListableBeanFactory; //导入方法依赖的package包/类
/**
 * Determine whether the given bean should be proxied with its target
 * class rather than its interfaces. Checks the
 * {@link #PRESERVE_TARGET_CLASS_ATTRIBUTE "preserveTargetClass" attribute}
 * of the corresponding bean definition.
 * @param beanFactory the containing ConfigurableListableBeanFactory
 * @param beanName the name of the bean
 * @return whether the given bean should be proxied with its target class
 */
public static boolean shouldProxyTargetClass(ConfigurableListableBeanFactory beanFactory, String beanName) {
	if (beanName != null && beanFactory.containsBeanDefinition(beanName)) {
		BeanDefinition bd = beanFactory.getBeanDefinition(beanName);
		return Boolean.TRUE.equals(bd.getAttribute(PRESERVE_TARGET_CLASS_ATTRIBUTE));
	}
	return false;
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:17,代码来源:AutoProxyUtils.java


注:本文中的org.springframework.beans.factory.config.ConfigurableListableBeanFactory.containsBeanDefinition方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。