public class BeanDefinitionHolder extends java.lang.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,
java.lang.String beanName)
Create a new BeanDefinitionHolder.
|
BeanDefinitionHolder(BeanDefinition beanDefinition,
java.lang.String beanName,
java.lang.String[] aliases)
Create a new BeanDefinitionHolder.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String[] |
getAliases()
Return the alias names for the bean, as specified directly for the bean definition.
|
BeanDefinition |
getBeanDefinition()
Return the wrapped BeanDefinition.
|
java.lang.String |
getBeanName()
Return the primary name of the bean, as specified for the bean definition.
|
java.lang.String |
getLongDescription()
Return a long description for the bean, including name and aliases
as well as a description of the contained
BeanDefinition . |
java.lang.String |
getShortDescription()
Return a friendly, short description for the bean, stating name and aliases.
|
java.lang.Object |
getSource()
Expose the bean definition's source object.
|
int |
hashCode() |
boolean |
matchesName(java.lang.String candidateName)
Determine whether the given candidate name matches the bean name
or the aliases stored in this bean definition.
|
java.lang.String |
toString()
This implementation returns the long description.
|
public BeanDefinitionHolder(BeanDefinition beanDefinition, java.lang.String beanName)
beanDefinition
- the BeanDefinition to wrapbeanName
- the name of the bean, as specified for the bean definitionpublic BeanDefinitionHolder(BeanDefinition beanDefinition, java.lang.String beanName, @Nullable java.lang.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 java.lang.String getBeanName()
@Nullable public java.lang.String[] getAliases()
null
if none@Nullable public java.lang.Object getSource()
getSource
in interface BeanMetadataElement
BeanMetadataElement.getSource()
public boolean matchesName(@Nullable java.lang.String candidateName)
public java.lang.String getShortDescription()
getBeanName()
,
getAliases()
public java.lang.String getLongDescription()
BeanDefinition
.getShortDescription()
,
getBeanDefinition()
public java.lang.String toString()
toString
in class java.lang.Object
getLongDescription()
,
getShortDescription()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object