类 BeanDefinitionHolder
- java.lang.Object
- org.springframework.beans.factory.config.BeanDefinitionHolder
- 所有已实现的接口:
BeanMetadataElement
- 直接已知子类:
BeanComponentDefinition
public class BeanDefinitionHolder extends Object implements BeanMetadataElement
Holder for a BeanDefinition with name and aliases. Can be registered as a placeholder for an inner bean.Can also be used for programmatic registration of inner bean definitions. If you don't care about BeanNameAware and the like, registering RootBeanDefinition or ChildBeanDefinition is good enough.
- 从以下版本开始:
- 1.0.2
- 作者:
- Juergen Hoeller
- 另请参阅:
BeanNameAware,RootBeanDefinition,ChildBeanDefinition
构造器概要
构造器 构造器 说明 BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)Create a new BeanDefinitionHolder.BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, String[] aliases)Create a new BeanDefinitionHolder.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 booleanequals(Object other)String[]getAliases()Return the alias names for the bean, as specified directly for the bean definition.BeanDefinitiongetBeanDefinition()Return the wrapped BeanDefinition.StringgetBeanName()Return the primary name of the bean, as specified for the bean definition.StringgetLongDescription()Return a long description for the bean, including name and aliases as well as a description of the containedBeanDefinition.StringgetShortDescription()Return a friendly, short description for the bean, stating name and aliases.ObjectgetSource()Expose the bean definition's source object.inthashCode()booleanmatchesName(String candidateName)Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.StringtoString()This implementation returns the long description.
构造器详细资料
BeanDefinitionHolder
public BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)
Create a new BeanDefinitionHolder.- 参数:
beanDefinition- the BeanDefinition to wrapbeanName- the name of the bean, as specified for the bean definition
BeanDefinitionHolder
public BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, @Nullable String[] aliases)
Create a new BeanDefinitionHolder.- 参数:
beanDefinition- the BeanDefinition to wrapbeanName- the name of the bean, as specified for the bean definitionaliases- alias names for the bean, ornullif none
BeanDefinitionHolder
public BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)
Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.Note: The wrapped BeanDefinition reference is taken as-is; it is
notdeeply copied.- 参数:
beanDefinitionHolder- the BeanDefinitionHolder to copy
方法详细资料
getBeanDefinition
public BeanDefinition getBeanDefinition()
Return the wrapped BeanDefinition.
getBeanName
public String getBeanName()
Return the primary name of the bean, as specified for the bean definition.
getAliases
@Nullable public String[] getAliases()
Return the alias names for the bean, as specified directly for the bean definition.- 返回:
- the array of alias names, or
nullif none
getSource
@Nullable public Object getSource()
Expose the bean definition's source object.- 指定者:
getSource在接口中BeanMetadataElement- 另请参阅:
BeanMetadataElement.getSource()
matchesName
public boolean matchesName(@Nullable String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.
getShortDescription
public String getShortDescription()
Return a friendly, short description for the bean, stating name and aliases.- 另请参阅:
getBeanName(),getAliases()
getLongDescription
public String getLongDescription()
Return a long description for the bean, including name and aliases as well as a description of the containedBeanDefinition.
toString
public String toString()
This implementation returns the long description. Can be overridden to return the short description or any kind of custom description instead.- 覆盖:
toString在类中Object- 另请参阅:
getLongDescription(),getShortDescription()