public class BeanDefinitionHolder extends Object implements BeanMetadataElement
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.
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 contained
BeanDefinition. |
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.
|
public BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)
beanDefinition - the BeanDefinition to wrapbeanName - the name of the bean, as specified for the bean definitionpublic BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, @Nullable String[] aliases)
beanDefinition - the BeanDefinition to wrapbeanName - the name of the bean, as specified for the bean definitionaliases - alias names for the bean, or null if nonepublic BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)
Note: The wrapped BeanDefinition reference is taken as-is;
it is not deeply copied.
beanDefinitionHolder - the BeanDefinitionHolder to copypublic BeanDefinition getBeanDefinition()
public String getBeanName()
@Nullable public String[] getAliases()
null if none@Nullable public Object getSource()
getSource 在接口中 BeanMetadataElementBeanMetadataElement.getSource()public boolean matchesName(@Nullable
String candidateName)
public String getShortDescription()
getBeanName(),
getAliases()public String getLongDescription()
BeanDefinition.public String toString()
toString 在类中 ObjectgetLongDescription(),
getShortDescription()