當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。