This is the only interface in Spring's bean factory packages that encapsulates registration of bean definitions. The standard BeanFactory interfaces only cover access to a fully configured factory instance.
Spring's bean definition readers expect to work on an implementation of this interface. Known implementors within the Spring core are DefaultListableBeanFactory and GenericApplicationContext.
org.springframework.beans.factory.config.BeanDefinition , AbstractBeanDefinition, RootBeanDefinition, ChildBeanDefinition, DefaultListableBeanFactory, org.springframework.context.support.GenericApplicationContext , org.springframework.beans.factory.xml.XmlBeanDefinitionReader , PropertiesBeanDefinitionReader
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: if this registry contains a bean definition with the given namethe name of the bean to look for beanName)Check if this registry contains a bean definition with the given name. |
| public BeanDefinition | Returns: the BeanDefinition for the given name (nevernull)name of the bean to find a definition for beanName)Return the BeanDefinition for the given bean name. |
| public int | Returns: the number of beans defined in the registryReturn the number of beans defined in the registry. |
| public String[] | Returns: the names of all beans defined in this registry, or an empty array if none definedReturn the names of all beans defined in this registry. |
| public default boolean | Returns: whether the definition for the given bean name is overridablethe name to check beanName)Determine whether the bean definition for the given name is overridable,
i.e. whether |
| public boolean | Returns: whether the given bean name is already in usethe name to check beanName)Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name. |
| public void | registerBeanDefinition(String
the name of the bean instance to register beanName, BeanDefinition definition of the bean instance to register beanDefinition)Register a new bean definition with this registry. |
| public void | removeBeanDefinition(String
the name of the bean instance to register beanName)Remove the BeanDefinition for the given name. |
| containsBeanDefinition | back to summary |
|---|---|
| public boolean containsBeanDefinition(String beanName) Check if this registry contains a bean definition with the given name.
| |
| getBeanDefinition | back to summary |
|---|---|
| public BeanDefinition getBeanDefinition(String beanName) throws NoSuchBeanDefinitionException Return the BeanDefinition for the given bean name.
| |
| getBeanDefinitionCount | back to summary |
|---|---|
| public int getBeanDefinitionCount() Return the number of beans defined in the registry.
| |
| getBeanDefinitionNames | back to summary |
|---|---|
| public String[] getBeanDefinitionNames() Return the names of all beans defined in this registry.
| |
| isBeanDefinitionOverridable | back to summary |
|---|---|
| public default boolean isBeanDefinitionOverridable(String beanName) Determine whether the bean definition for the given name is overridable,
i.e. whether The default implementation returns
| |
| isBeanNameInUse | back to summary |
|---|---|
| public boolean isBeanNameInUse(String beanName) Determine whether the given bean name is already in use within this registry, i.e. whether there is a local bean or alias registered under this name.
| |
| registerBeanDefinition | back to summary |
|---|---|
| public void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.
| |
| removeBeanDefinition | back to summary |
|---|---|
| public void removeBeanDefinition(String beanName) throws NoSuchBeanDefinitionException Remove the BeanDefinition for the given name.
| |