Class RegisteredBean
java.lang.Object
org.springframework.beans.factory.support.RegisteredBean
A
RegisteredBean represents a bean that has been registered with a
BeanFactory, but has not necessarily been instantiated. It provides
access to the bean factory that contains the bean as well as the bean name.
In the case of inner-beans, the bean name may have been generated.- Since:
- 6.0
- Author:
- Phillip Webb
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>Return the user-defined class of the bean.Return the bean factory containing the bean.Return the name of the bean.Return theResolvableTypeof the bean.Return the merged bean definition of the bean.Return the parent of this instance ornullif not an inner-bean.booleanReturn if the bean name is generated.booleanReturn if this instance is for an inner-bean.static RegisteredBeanof(ConfigurableBeanFactory beanFactory, String beanName) Create a newRegisteredBeaninstance for a regular bean.static RegisteredBeanofInnerBean(RegisteredBean parent, String innerBeanName, BeanDefinition innerBeanDefinition) Create a newRegisteredBeaninstance for an inner-bean.static RegisteredBeanofInnerBean(RegisteredBean parent, BeanDefinition innerBeanDefinition) Create a newRegisteredBeaninstance for an inner-bean.static RegisteredBeanofInnerBean(RegisteredBean parent, BeanDefinitionHolder innerBean) Create a newRegisteredBeaninstance for an inner-bean.toString()
-
Method Details
-
of
Create a newRegisteredBeaninstance for a regular bean.- Parameters:
beanFactory- the source bean factorybeanName- the bean name- Returns:
- a new
RegisteredBeaninstance
-
ofInnerBean
Create a newRegisteredBeaninstance for an inner-bean.- Parameters:
parent- the parent of the inner-beaninnerBean- aBeanDefinitionHolderfor the inner bean- Returns:
- a new
RegisteredBeaninstance
-
ofInnerBean
Create a newRegisteredBeaninstance for an inner-bean.- Parameters:
parent- the parent of the inner-beaninnerBeanDefinition- the inner-bean definition- Returns:
- a new
RegisteredBeaninstance
-
ofInnerBean
public static RegisteredBean ofInnerBean(RegisteredBean parent, @Nullable String innerBeanName, BeanDefinition innerBeanDefinition) Create a newRegisteredBeaninstance for an inner-bean.- Parameters:
parent- the parent of the inner-beaninnerBeanName- the name of the inner bean ornullto generate a nameinnerBeanDefinition- the inner-bean definition- Returns:
- a new
RegisteredBeaninstance
-
getBeanName
Return the name of the bean.- Returns:
- the beanName the bean name
-
isGeneratedBeanName
public boolean isGeneratedBeanName()Return if the bean name is generated.- Returns:
trueif the name was generated
-
getBeanFactory
Return the bean factory containing the bean.- Returns:
- the bean factory
-
getBeanClass
Return the user-defined class of the bean.- Returns:
- the bean class
-
getBeanType
Return theResolvableTypeof the bean.- Returns:
- the bean type
-
getMergedBeanDefinition
Return the merged bean definition of the bean.- Returns:
- the merged bean definition
- See Also:
-
isInnerBean
public boolean isInnerBean()Return if this instance is for an inner-bean.- Returns:
- if an inner-bean
-
getParent
Return the parent of this instance ornullif not an inner-bean.- Returns:
- the parent
-
toString
-