|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for registries that hold bean definitions, i.e. RootBeanDefinition and ChildBeanDefinition instances.
Typically implemented by bean factories that work with the AbstractBeanDefinition hierarchy internally.
Method Summary | |
boolean |
containsBeanDefinition(String beanName)
Check if this registry contains a bean definition with the given name. |
String[] |
getAliases(String beanName)
Return the aliases for the given bean name, if defined. |
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. |
void |
registerAlias(String beanName,
String alias)
Given a bean name, create an alias. |
void |
registerBeanDefinition(String beanName,
BeanDefinition beanDefinition)
Register a new bean definition with this registry. |
Method Detail |
public int getBeanDefinitionCount()
public String[] getBeanDefinitionNames()
public boolean containsBeanDefinition(String beanName)
beanName
- the name of the bean to look for
public BeanDefinition getBeanDefinition(String beanName) throws BeansException
beanName
- name of the bean to find a definition for
NoSuchBeanDefinitionException
- if the bean definition cannot be resolved
BeansException
- in case of errorspublic void registerBeanDefinition(String beanName, BeanDefinition beanDefinition) throws BeansException
beanName
- the name of the bean instance to registerbeanDefinition
- definition of the bean instance to register
BeansException
- if the bean definition is invalidRootBeanDefinition
,
ChildBeanDefinition
public String[] getAliases(String beanName) throws NoSuchBeanDefinitionException
Will ask the parent factory if the bean cannot be found in this factory instance.
beanName
- the bean name to check for aliases
NoSuchBeanDefinitionException
- if there's no such bean definitionpublic void registerAlias(String beanName, String alias) throws BeansException
beanName
- the name of the beanalias
- alias that will behave the same as the bean name
NoSuchBeanDefinitionException
- if there is no bean with the given name
BeansException
- if the alias is already in use
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |