类 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.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 boolean
equals(Object other)
String[]
getAliases()
Return the alias names for the bean, as specified directly for the bean definition.BeanDefinition
getBeanDefinition()
Return the wrapped BeanDefinition.String
getBeanName()
Return the primary name of the bean, as specified for the bean definition.String
getLongDescription()
Return a long description for the bean, including name and aliases as well as a description of the containedBeanDefinition
.String
getShortDescription()
Return a friendly, short description for the bean, stating name and aliases.Object
getSource()
Expose the bean definition's source object.int
hashCode()
boolean
matchesName(String candidateName)
Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.String
toString()
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, ornull
if 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
not
deeply 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
null
if 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()