@Deprecated public class BeanDefinitionUtils extends Object
bean definitions for a ListableBeanFactory and to conditionally
register bean definitions.| Constructor and Description |
|---|
BeanDefinitionUtils()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static BeanDefinitionBuilder |
createBeanDefinitionBuilderIfNoBeanDefinitionOfTypeExists(ListableBeanFactory factory,
Class<?> requiredType,
Class<?> instantiableType,
BeanDefinitionBuilderArgument... constructorArgs)
Deprecated.
Returns a
BeanDefinitionBuilder iff no BeanDefinition of the required type is found in the given
ListableBeanFactory, otherwise returns null, indicating that at least one existed. |
static BeanDefinitionHolder[] |
getBeanDefinitionsOfType(BeanDefinitionRegistry registry,
ListableBeanFactory factory,
Class<?> type,
boolean includeNonSingletons,
boolean allowEagerInit)
Deprecated.
Returns all
BeanDefinitionHolders with the given type. |
static BeanDefinitionHolder |
getSingleBeanDefinitionOfType(BeanDefinitionRegistry registry,
ListableBeanFactory factory,
Class<?> type,
boolean includeNonSingletons,
boolean allowEagerInit,
boolean required)
Deprecated.
Returns the single
BeanDefinitionHolder with the given type, or null of none were found and
required was false, otherwise throws IllegalArgumentException. |
public static BeanDefinitionBuilder createBeanDefinitionBuilderIfNoBeanDefinitionOfTypeExists(ListableBeanFactory factory, Class<?> requiredType, Class<?> instantiableType, BeanDefinitionBuilderArgument... constructorArgs)
BeanDefinitionBuilder iff no BeanDefinition of the required type is found in the given
ListableBeanFactory, otherwise returns null, indicating that at least one existed.factory - The ListableBeanFactory in which to look for the BeanDefinition, including
ancestors.requiredType - The BeanDefinition's required type.instantiableType - The instantiable type for the BeanDefinitionBuilder.constructorArgs - Any BeanDefinitionBuilderArguments required by the instantiableType's constructor.BeanDefinitionBuilder iff no BeanDefinition of the required type is found, otherwise
null.createBeanDefinitionBuilderIfNoBeanDefinitionOfTypeExists(ListableBeanFactory, Class,
Class, BeanDefinitionBuilderArgument...),
BeanDefinitionBuilderArgument#ref(Object),
BeanDefinitionBuilderArgument.val(Object)public static BeanDefinitionHolder getSingleBeanDefinitionOfType(BeanDefinitionRegistry registry, ListableBeanFactory factory, Class<?> type, boolean includeNonSingletons, boolean allowEagerInit, boolean required)
BeanDefinitionHolder with the given type, or null of none were found and
required was false, otherwise throws IllegalArgumentException.registry - The BeanDefinitionRegistry, often the very same instance as the factor
parameter.factory - The ListableBeanFactory, often the very same instance as the registry
parameter.type - The required BeanDefinition's type.includeNonSingletons - Whether to include beans with scope other than singletonallowEagerInit - Whether to allow eager initialization of beans.required - Whether to allow the return of null if none were found.BeanDefinitionHolder or null if none found, depending on the value of required.IllegalArgumentException - If multiple were found.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)public static BeanDefinitionHolder[] getBeanDefinitionsOfType(BeanDefinitionRegistry registry, ListableBeanFactory factory, Class<?> type, boolean includeNonSingletons, boolean allowEagerInit)
BeanDefinitionHolders with the given type.registry - The BeanDefinitionRegistry, often the very same instance as the factor
parameter.factory - The ListableBeanFactory, often the very same instance as the registry
parameter.type - The required BeanDefinition's type.includeNonSingletons - Whether to include beans with scope other than singletonallowEagerInit - Whether to allow eager initialization of beans.required - Whether to allow the return of null if none were found.BeanDefinitionHolders -- never returns null.BeanFactoryUtils.beanNamesForTypeIncludingAncestors(ListableBeanFactory, Class, boolean, boolean)Copyright © 2011–2019 Pivotal Software, Inc.. All rights reserved.