public class

BeanDefinitionHolder

extends Object
implements BeanMetadataElement
java.lang.Object
   ↳ org.springframework.beans.factory.config.BeanDefinitionHolder
Known Direct Subclasses

Class Overview

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.

Summary

Public Constructors
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName)
Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinition beanDefinition, String beanName, String[] aliases)
Create a new BeanDefinitionHolder.
BeanDefinitionHolder(BeanDefinitionHolder beanDefinitionHolder)
Copy constructor: Create a new BeanDefinitionHolder with the same contents as the given BeanDefinitionHolder instance.
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.springframework.beans.BeanMetadataElement

Public Constructors

public BeanDefinitionHolder (BeanDefinition beanDefinition, String beanName)

Also: SpringBeans

Create a new BeanDefinitionHolder.

Parameters
beanDefinition the BeanDefinition to wrap
beanName the name of the bean, as specified for the bean definition

public BeanDefinitionHolder (BeanDefinition beanDefinition, String beanName, String[] aliases)

Also: SpringBeans

Create a new BeanDefinitionHolder.

Parameters
beanDefinition the BeanDefinition to wrap
beanName the name of the bean, as specified for the bean definition
aliases alias names for the bean, or null if none

public BeanDefinitionHolder (BeanDefinitionHolder beanDefinitionHolder)

Also: SpringBeans

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.

Parameters
beanDefinitionHolder the BeanDefinitionHolder to copy

Public Methods

public boolean equals (Object other)

public String[] getAliases ()

Also: SpringBeans

Return the alias names for the bean, as specified directly for the bean definition.

Returns
  • the array of alias names, or null if none

public BeanDefinition getBeanDefinition ()

Also: SpringBeans

Return the wrapped BeanDefinition.

public String getBeanName ()

Also: SpringBeans

Return the primary name of the bean, as specified for the bean definition.

public String getLongDescription ()

Also: SpringBeans

Return a long description for the bean, including name and aliases as well as a description of the contained BeanDefinition.

public String getShortDescription ()

Also: SpringBeans

Return a friendly, short description for the bean, stating name and aliases.

public Object getSource ()

Also: SpringBeans

Expose the bean definition's source object.

See Also

public int hashCode ()

public boolean matchesName (String candidateName)

Also: SpringBeans

Determine whether the given candidate name matches the bean name or the aliases stored in this bean definition.

public String toString ()

This implementation returns the long description. Can be overridden to return the short description or any kind of custom description instead.