Package io.micronaut.inject
Interface BeanFactory<T>
-
- Type Parameters:
T
- The bean type
- All Known Subinterfaces:
ParametrizedBeanFactory<T>
,RuntimeBeanDefinition<T>
- All Known Implementing Classes:
AbstractParametrizedBeanDefinition
,AbstractProviderDefinition
,ApplicationEventPublisherFactory
,BeanProviderDefinition
,JakartaProviderBeanDefinition
,JavaxProviderBeanDefinition
public interface BeanFactory<T>
An interface for classes that are capable of taking the
BeanDefinition
instance and building a concrete instance. This interface is generally implemented by a build time tool such as an AST transformation framework that will build the code necessary to construct a valid bean instance.- Since:
- 1.0
- See Also:
BeanDefinitionWriter
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default T
build(BeanContext context, BeanDefinition<T> definition)
Builds a bean instance.T
build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition)
Builds a bean instance.
-
-
-
Method Detail
-
build
default T build(BeanContext context, BeanDefinition<T> definition) throws BeanInstantiationException
Builds a bean instance.- Parameters:
context
- The contextdefinition
- The definition- Returns:
- The instance
- Throws:
BeanInstantiationException
- if the instance could not be instantiated
-
build
T build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition) throws BeanInstantiationException
Builds a bean instance.- Parameters:
resolutionContext
- The bean resolution contextcontext
- The contextdefinition
- The definition- Returns:
- The instance
- Throws:
BeanInstantiationException
- if the instance could not be instantiated
-
-