Package org.springframework.beans.factory.parsing

# Class BeanComponentDefinition

java.lang.Object
org.springframework.beans.factory.config.BeanDefinitionHolder
org.springframework.beans.factory.parsing.BeanComponentDefinition

All Implemented Interfaces:
  `BeanMetadataElement`, `ComponentDefinition`

public class BeanComponentDefinition extends BeanDefinitionHolder implements ComponentDefinition
ComponentDefinition based on a standard BeanDefinition, exposing the given bean definition as well as inner bean definitions and bean references for the given bean.

Since:
  2.0
Author:
  Rob Harrop, Juergen Hoeller

## Constructor Summary

Constructors
Constructor
Description
`BeanComponentDefinition(BeanDefinitionHolder beanDefinitionHolder)`
Create a new BeanComponentDefinition for the given bean.
`BeanComponentDefinition(BeanDefinition beanDefinition, String beanName)`
Create a new BeanComponentDefinition for the given bean.
`BeanComponentDefinition(BeanDefinition beanDefinition, String beanName, String[] aliases)`
Create a new BeanComponentDefinition for the given bean.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object other)`
This implementation expects the other object to be of type BeanComponentDefinition as well, in addition to the superclass's equality requirements.
`BeanDefinition[]`
`getBeanDefinitions()`
Return the `BeanDefinitions` that were registered to form this `ComponentDefinition`.
`BeanReference[]`
`getBeanReferences()`
Return the set of `BeanReferences` that are considered to be important to this `ComponentDefinition`.
`String`
`getDescription()`
Return a friendly description of the described component.
`BeanDefinition[]`
`getInnerBeanDefinitions()`
Return the `BeanDefinitions` that represent all relevant inner beans within this component.
`String`
`getName()`
Get the user-visible name of this `ComponentDefinition`.
`String`
`toString()`
This implementation returns this ComponentDefinition's description.

### Methods inherited from class org.springframework.beans.factory.config.BeanDefinitionHolder

`getAliases, getBeanDefinition, getBeanName, getLongDescription, getShortDescription, getSource, hashCode, matchesName`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.springframework.beans.BeanMetadataElement

`getSource`

## Constructor Details

### BeanComponentDefinition

public BeanComponentDefinition(BeanDefinition beanDefinition, String beanName)
Create a new BeanComponentDefinition for the given bean.

Parameters:
  `beanDefinition` - the BeanDefinition
  `beanName` - the name of the bean

### BeanComponentDefinition

public BeanComponentDefinition(BeanDefinition beanDefinition, String beanName, @Nullable String[] aliases)
Create a new BeanComponentDefinition for the given bean.

Parameters:
  `beanDefinition` - the BeanDefinition
  `beanName` - the name of the bean
  `aliases` - alias names for the bean, or `null` if none

### BeanComponentDefinition

public BeanComponentDefinition(BeanDefinitionHolder beanDefinitionHolder)
Create a new BeanComponentDefinition for the given bean.

Parameters:
  `beanDefinitionHolder` - the BeanDefinitionHolder encapsulating the bean definition as well as the name of the bean

## Method Details

### getName

public String getName()
Description copied from interface: `ComponentDefinition`
Get the user-visible name of this `ComponentDefinition`.

This should link back directly to the corresponding configuration data for this component in a given context.

Specified by:
  `getName` in interface `ComponentDefinition`

### getDescription

public String getDescription()
Description copied from interface: `ComponentDefinition`
Return a friendly description of the described component.

Implementations are encouraged to return the same value from `toString()`.

Specified by:
  `getDescription` in interface `ComponentDefinition`

### getBeanDefinitions

public BeanDefinition[] getBeanDefinitions()
Description copied from interface: `ComponentDefinition`
Return the `BeanDefinitions` that were registered to form this `ComponentDefinition`.

It should be noted that a `ComponentDefinition` may well be related with other `BeanDefinitions` via `references`, however these are not included as they may be not available immediately. Important `BeanReferences` are available from `ComponentDefinition.getBeanReferences()`.

Specified by:
  `getBeanDefinitions` in interface `ComponentDefinition`
Returns:
  the array of BeanDefinitions, or an empty array if none

### getInnerBeanDefinitions

public BeanDefinition[] getInnerBeanDefinitions()
Description copied from interface: `ComponentDefinition`
Return the `BeanDefinitions` that represent all relevant inner beans within this component.

Other inner beans may exist within the associated `BeanDefinitions`, however these are not considered to be needed for validation or for user visualization.

Specified by:
  `getInnerBeanDefinitions` in interface `ComponentDefinition`
Returns:
  the array of BeanDefinitions, or an empty array if none

### getBeanReferences

public BeanReference[] getBeanReferences()
Description copied from interface: `ComponentDefinition`
Return the set of `BeanReferences` that are considered to be important to this `ComponentDefinition`.

Other `BeanReferences` may exist within the associated `BeanDefinitions`, however these are not considered to be needed for validation or for user visualization.

Specified by:
  `getBeanReferences` in interface `ComponentDefinition`
Returns:
  the array of BeanReferences, or an empty array if none

### toString

public String toString()
This implementation returns this ComponentDefinition's description.

Overrides:
  `toString` in class `BeanDefinitionHolder`
See Also:
  - `getDescription()`

### equals

public boolean equals(@Nullable Object other)
This implementation expects the other object to be of type BeanComponentDefinition as well, in addition to the superclass's equality requirements.

Overrides:
  `equals` in class `BeanDefinitionHolder`