public class SimpleBeanDefinitionRegistry extends SimpleAliasRegistry implements BeanDefinitionRegistry
BeanDefinitionRegistry
interface.
Provides registry capabilities only, with no factory capabilities built in.
Can for example be used for testing bean definition readers.Constructor and Description |
---|
SimpleBeanDefinitionRegistry() |
Modifier and Type | Method and Description |
---|---|
boolean |
containsBeanDefinition(java.lang.String beanName)
Check if this registry contains a bean definition with the given name.
|
BeanDefinition |
getBeanDefinition(java.lang.String beanName)
Return the BeanDefinition for the given bean name.
|
int |
getBeanDefinitionCount()
Return the number of beans defined in the registry.
|
java.lang.String[] |
getBeanDefinitionNames()
Return the names of all beans defined in this registry.
|
boolean |
isBeanNameInUse(java.lang.String beanName)
Determine whether the given bean name is already in use within this registry,
i.e.
|
void |
registerBeanDefinition(java.lang.String beanName,
BeanDefinition beanDefinition)
Register a new bean definition with this registry.
|
void |
removeBeanDefinition(java.lang.String beanName)
Remove the BeanDefinition for the given name.
|
allowAliasOverriding, canonicalName, checkForAliasCircle, getAliases, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAliases, isAlias, registerAlias, removeAlias
public void registerBeanDefinition(java.lang.String beanName, BeanDefinition beanDefinition) throws BeanDefinitionStoreException
BeanDefinitionRegistry
registerBeanDefinition
in interface BeanDefinitionRegistry
beanName
- the name of the bean instance to registerbeanDefinition
- definition of the bean instance to registerBeanDefinitionStoreException
- if the BeanDefinition is invalid
or if there is already a BeanDefinition for the specified bean name
(and we are not allowed to override it)GenericBeanDefinition
,
RootBeanDefinition
,
ChildBeanDefinition
public void removeBeanDefinition(java.lang.String beanName) throws NoSuchBeanDefinitionException
BeanDefinitionRegistry
removeBeanDefinition
in interface BeanDefinitionRegistry
beanName
- the name of the bean instance to registerNoSuchBeanDefinitionException
- if there is no such bean definitionpublic BeanDefinition getBeanDefinition(java.lang.String beanName) throws NoSuchBeanDefinitionException
BeanDefinitionRegistry
getBeanDefinition
in interface BeanDefinitionRegistry
beanName
- name of the bean to find a definition fornull
)NoSuchBeanDefinitionException
- if there is no such bean definitionpublic boolean containsBeanDefinition(java.lang.String beanName)
BeanDefinitionRegistry
containsBeanDefinition
in interface BeanDefinitionRegistry
beanName
- the name of the bean to look forpublic java.lang.String[] getBeanDefinitionNames()
BeanDefinitionRegistry
getBeanDefinitionNames
in interface BeanDefinitionRegistry
public int getBeanDefinitionCount()
BeanDefinitionRegistry
getBeanDefinitionCount
in interface BeanDefinitionRegistry
public boolean isBeanNameInUse(java.lang.String beanName)
BeanDefinitionRegistry
isBeanNameInUse
in interface BeanDefinitionRegistry
beanName
- the name to check