Package org.springframework.beans.factory.support

# Class DefaultBeanNameGenerator

java.lang.Object
org.springframework.beans.factory.support.DefaultBeanNameGenerator

All Implemented Interfaces:
  `BeanNameGenerator`

public class DefaultBeanNameGenerator extends Object implements BeanNameGenerator
Default implementation of the `BeanNameGenerator` interface, delegating to `BeanDefinitionReaderUtils.generateBeanName(BeanDefinition, BeanDefinitionRegistry)`.

Since:
  2.0.3
Author:
  Juergen Hoeller

## Field Summary

Fields
Modifier and Type
Field
Description
`static final DefaultBeanNameGenerator`
`INSTANCE`
A convenient constant for a default `DefaultBeanNameGenerator` instance, as used for `AbstractBeanDefinitionReader` setup.

## Constructor Summary

Constructors
Constructor
Description
`DefaultBeanNameGenerator()`

## Method Summary

Modifier and Type
Method
Description
`String`
`generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)`
Generate a bean name for the given bean definition.

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### INSTANCE

public static final DefaultBeanNameGenerator INSTANCE
A convenient constant for a default `DefaultBeanNameGenerator` instance, as used for `AbstractBeanDefinitionReader` setup.

Since:
  5.2

## Constructor Details

### DefaultBeanNameGenerator

public DefaultBeanNameGenerator()

## Method Details

### generateBeanName

public String generateBeanName(BeanDefinition definition, BeanDefinitionRegistry registry)
Description copied from interface: `BeanNameGenerator`
Generate a bean name for the given bean definition.

Specified by:
  `generateBeanName` in interface `BeanNameGenerator`
Parameters:
  `definition` - the bean definition to generate a name for
  `registry` - the bean definition registry that the given definition is supposed to be registered with
Returns:
  the generated bean name