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 SummaryModifier 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(ConfigurableListableBeanFactory 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.resolveAutowiredArgument(DependencyDescriptor descriptor, TypeConverter typeConverter, Set<String> autowiredBeanNames) Resolve an autowired argument.Resolve the constructor or factory method to use for this bean.toString()
- 
Method Details- 
ofCreate a newRegisteredBeaninstance for a regular bean.- Parameters:
- beanFactory- the source bean factory
- beanName- the bean name
- Returns:
- a new RegisteredBeaninstance
 
- 
ofInnerBeanCreate a newRegisteredBeaninstance for an inner-bean.- Parameters:
- parent- the parent of the inner-bean
- innerBean- a- BeanDefinitionHolderfor the inner bean
- Returns:
- a new RegisteredBeaninstance
 
- 
ofInnerBeanCreate a newRegisteredBeaninstance for an inner-bean.- Parameters:
- parent- the parent of the inner-bean
- innerBeanDefinition- the inner-bean definition
- Returns:
- a new RegisteredBeaninstance
 
- 
ofInnerBeanpublic static RegisteredBean ofInnerBean(RegisteredBean parent, @Nullable String innerBeanName, BeanDefinition innerBeanDefinition) Create a newRegisteredBeaninstance for an inner-bean.- Parameters:
- parent- the parent of the inner-bean
- innerBeanName- the name of the inner bean or- nullto generate a name
- innerBeanDefinition- the inner-bean definition
- Returns:
- a new RegisteredBeaninstance
 
- 
getBeanNameReturn the name of the bean.- Returns:
- the beanName the bean name
 
- 
isGeneratedBeanNamepublic boolean isGeneratedBeanName()Return if the bean name is generated.- Returns:
- trueif the name was generated
 
- 
getBeanFactoryReturn the bean factory containing the bean.- Returns:
- the bean factory
 
- 
getBeanClassReturn the user-defined class of the bean.- Returns:
- the bean class
 
- 
getBeanTypeReturn theResolvableTypeof the bean.- Returns:
- the bean type
 
- 
getMergedBeanDefinitionReturn the merged bean definition of the bean.- Returns:
- the merged bean definition
- See Also:
 
- 
isInnerBeanpublic boolean isInnerBean()Return if this instance is for an inner-bean.- Returns:
- if an inner-bean
 
- 
getParentReturn the parent of this instance ornullif not an inner-bean.- Returns:
- the parent
 
- 
resolveConstructorOrFactoryMethodResolve the constructor or factory method to use for this bean.- Returns:
- the ConstructororMethod
 
- 
resolveAutowiredArgument@Nullable public Object resolveAutowiredArgument(DependencyDescriptor descriptor, TypeConverter typeConverter, Set<String> autowiredBeanNames) Resolve an autowired argument.- Parameters:
- descriptor- the descriptor for the dependency (field/method/constructor)
- typeConverter- the TypeConverter to use for populating arrays and collections
- autowiredBeanNames- a Set that all names of autowired beans (used for resolving the given dependency) are supposed to be added to
- Returns:
- the resolved object, or nullif none found
- Since:
- 6.0.9
 
- 
toString
 
-