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
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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
in interface BeanMetadataElement
BeanMetadataElement.getSource()
public boolean matchesName(@Nullable String candidateName)
public String getShortDescription()
getBeanName()
,
getAliases()
public String getLongDescription()
BeanDefinition
.getShortDescription()
,
getBeanDefinition()
public String toString()
toString
in class Object
getLongDescription()
,
getShortDescription()