Package org.springframework.beans.factory.aot

# Interface BeanFactoryInitializationCode

public interface BeanFactoryInitializationCode
Interface that can be used to configure the code that will be generated to perform bean factory initialization.

Since:
  6.0
Author:
  Phillip Webb, Stephane Nicoll
See Also:
  - `BeanFactoryInitializationAotContribution`

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`BEAN_FACTORY_VARIABLE`
The recommended variable name to use to refer to the bean factory.

## Method Summary

Modifier and Type
Method
Description
`void`
`addInitializer(org.springframework.aot.generate.MethodReference methodReference)`
Add an initializer method call.
`org.springframework.aot.generate.GeneratedMethods`
`getMethods()`
Get the `GeneratedMethods` used by the initializing code.

## Field Details

### BEAN_FACTORY_VARIABLE

static final String BEAN_FACTORY_VARIABLE
The recommended variable name to use to refer to the bean factory.

See Also:
  - Constant Field Values

## Method Details

### getMethods

org.springframework.aot.generate.GeneratedMethods getMethods()
Get the `GeneratedMethods` used by the initializing code.

Returns:
  the generated methods

### addInitializer

void addInitializer(org.springframework.aot.generate.MethodReference methodReference)
Add an initializer method call. An initializer can use a flexible signature, using any of the following:

- `DefaultListableBeanFactory`, or `ConfigurableListableBeanFactory` to use the bean factory.
- `ConfigurableEnvironment` or `Environment` to access the environment.
- `ResourceLoader` to load resources.

Parameters:
  `methodReference` - a reference to the initialize method to call.