Package io.micronaut.inject
Interface ParametrizedBeanFactory<T>
-
- Type Parameters:
T
- The type
- All Superinterfaces:
BeanFactory<T>
- All Known Implementing Classes:
AbstractParametrizedBeanDefinition
public interface ParametrizedBeanFactory<T> extends BeanFactory<T>
ABeanFactory
that requires additional (possibly user supplied) parameters in order construct a bean.- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default T
build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition)
Builds a bean instance.T
build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition, java.util.Map<java.lang.String,java.lang.Object> requiredArgumentValues)
Variation of theBeanFactory.build(BeanContext, BeanDefinition)
method that allows passing the values necessary for successful bean construction.io.micronaut.core.type.Argument<?>[]
getRequiredArguments()
-
Methods inherited from interface io.micronaut.inject.BeanFactory
build
-
-
-
-
Method Detail
-
getRequiredArguments
io.micronaut.core.type.Argument<?>[] getRequiredArguments()
- Returns:
- The arguments required to construct this bean
-
build
T build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition, java.util.Map<java.lang.String,java.lang.Object> requiredArgumentValues) throws BeanInstantiationException
Variation of theBeanFactory.build(BeanContext, BeanDefinition)
method that allows passing the values necessary for successful bean construction.- Parameters:
resolutionContext
- TheBeanResolutionContext
context
- TheBeanContext
definition
- TheBeanDefinition
requiredArgumentValues
- The required arguments values. The keys should match the names of the arguments returned bygetRequiredArguments()
- Returns:
- The instantiated bean
- Throws:
BeanInstantiationException
- If the bean cannot be instantiated for the arguments supplied
-
build
default T build(BeanResolutionContext resolutionContext, BeanContext context, BeanDefinition<T> definition) throws BeanInstantiationException
Description copied from interface:BeanFactory
Builds a bean instance.- Specified by:
build
in interfaceBeanFactory<T>
- Parameters:
resolutionContext
- The bean resolution contextcontext
- The contextdefinition
- The definition- Returns:
- The instance
- Throws:
BeanInstantiationException
- if the instance could not be instantiated
-
-