Module io.avaje.inject
Package io.avaje.inject
@NullMarked
package io.avaje.inject
Avaje Inject API - see
BeanScope.
// Annotate classes with @Singleton, @Factory etc
@Singleton
public class CoffeeMaker { ... }
@Singleton
public class Pump { ... }
--------------------------------------------------
// Create BeanScope to wire and access beans
BeanScope scope = BeanScope.builder()
.build();
// use it
CoffeeMaker coffeeMaker = scope.get(CoffeeMaker.class);
coffeeMaker.makeIt();
// close it to fire preDestroy lifecycle methods
scope.close();
-
ClassDescriptionUsed with
AssistFactoryto mark the properties that are provided as parameters to the factory method.Annotate a bean for which we want to generate a factory.Marks methods on a@Factorybean that create dependencies.A bean entry with priority and optional name.Holds beans created by dependency injection.Build a bean scope with options for shutdown hook and supplying external dependencies.Extends the building with testing specific support for mocks and spies.Limits the types exposed by this bean to the given types.Identify a bean as component with singleton scope that avaje-inject will use.Specify types to generate DI classes for.Marks dependencies as an external beans potentially not managed by avaje inject.A singleton bean that has methods marked with the@Beanannotation.Used to explicitly specify whether the current module depends on/provides beans or aspects.Marks a class or factory method bean to be initialized lazily.Control whether a compile-time proxy is generated to support lazy initialization.ThePostConstructannotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.ThePreDestroyannotation is used on a method as a callback notification to signal that the instance is in the process of being removed by the container.Identify a bean as the preferred bean to inject when multiple beans implement the intended interface.ThePriorityannotation can be applied to classes to indicate the wiring priority of a bean to resolve cases where multiple beans of the same type exist.Expresses a requirement for a bean to be wired/registered into theBeanScope.Specify a bean that has prototype scope.Marks anMap<String, T>field/parameter to receive a map of beans keyed by qualifier name.Expresses a requirement for a bean to be wired/registered into theBeanScope.Expresses a requirement for a bean to be wired/registered into theBeanScope.Identify a bean as being the least preferred bean to inject when multiple beans implement the intended interface.