public class

SimpleBeanDefinitionRegistry

extends SimpleAliasRegistry
implements BeanDefinitionRegistry
java.lang.Object
   ↳ org.springframework.core.SimpleAliasRegistry
     ↳ org.springframework.beans.factory.support.SimpleBeanDefinitionRegistry

Class Overview

Simple implementation of the BeanDefinitionRegistry interface. Provides registry capabilities only, with no factory capabilities built in. Can for example be used for testing bean definition readers.

Summary

Public Constructors
SimpleBeanDefinitionRegistry()
Public Methods
boolean containsBeanDefinition(String beanName)
Check if this registry contains a bean definition with the given name.
BeanDefinition getBeanDefinition(String beanName)
Return the BeanDefinition for the given bean name.
int getBeanDefinitionCount()
Return the number of beans defined in the registry.
String[] getBeanDefinitionNames()
Return the names of all beans defined in this registry.
boolean isBeanNameInUse(String beanName)
Determine whether the given bean name is already in use within this registry, i.e.
void registerBeanDefinition(String beanName, BeanDefinition beanDefinition)
Register a new bean definition with this registry.
void removeBeanDefinition(String beanName)
Remove the BeanDefinition for the given name.
[Expand]
Inherited Methods
From class org.springframework.core.SimpleAliasRegistry
From class java.lang.Object
From interface org.springframework.beans.factory.support.BeanDefinitionRegistry
From interface org.springframework.core.AliasRegistry

Public Constructors

public SimpleBeanDefinitionRegistry ()

Also: SpringBeans

Public Methods

public boolean containsBeanDefinition (String beanName)

Also: SpringBeans

Check if this registry contains a bean definition with the given name.

Parameters
beanName the name of the bean to look for
Returns
  • if this registry contains a bean definition with the given name

public BeanDefinition getBeanDefinition (String beanName)

Also: SpringBeans

Return the BeanDefinition for the given bean name.

Parameters
beanName name of the bean to find a definition for
Returns
  • the BeanDefinition for the given name (never null)

public int getBeanDefinitionCount ()

Also: SpringBeans

Return the number of beans defined in the registry.

Returns
  • the number of beans defined in the registry

public String[] getBeanDefinitionNames ()

Also: SpringBeans

Return the names of all beans defined in this registry.

Returns
  • the names of all beans defined in this registry, or an empty array if none defined

public boolean isBeanNameInUse (String beanName)

Also: SpringBeans

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.

Parameters
beanName the name to check
Returns
  • whether the given bean name is already in use

public void registerBeanDefinition (String beanName, BeanDefinition beanDefinition)

Also: SpringBeans

Register a new bean definition with this registry. Must support RootBeanDefinition and ChildBeanDefinition.

Parameters
beanName the name of the bean instance to register
beanDefinition definition of the bean instance to register

public void removeBeanDefinition (String beanName)

Also: SpringBeans

Remove the BeanDefinition for the given name.

Parameters
beanName the name of the bean instance to register