|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
See:
Description
Interface Summary | |
---|---|
Injector | Interface used to perform injection with. |
InjectorFactory | The injector factory is responsible for creating injectors for a given class. |
Class Summary | |
---|---|
Injectable | This abstract base class performs injection at construction. |
InjectorBuilder | Utility for obtaining an implementation of the InjectorFactory using
ServiceLoader and for obtaining a SimpleInjector . |
InjectorCache | Cache of CdiInjector s for efficiency to avoid duplicate analysis of a
given class. |
SimpleInjector | The main entry point for programmatic dependency injection. |
This package provides a mini-framework for interfacing to existing dependency injection mechanisms. This package does not provide dependency injection, but implementations are expected to implement it, usually by delegating to an existing dependency injection framework. The interfaces in this package provide independence on the actual framework chosen and also allow for better testability.
Users of this package will typically use:
Injector
: This is the interface used to perform injection of dependencies into
a given object. Injectable
: By subclassing this class, the classes automatically get their
dependencies injected at construction. InjectorBuilder
: To get an instance of the Injector
.
For example, to inject into a given object, use:
Injector injector = InjectorBuilder.getInjector(); MyPojo pojo = new MyPojo(); injector.inject(pojo);
Of interest to implementations of this package integrating with dependency injection frameworks are:
Injector
: The main interface to be implemented is the Injector
, by which injection is done.InjectorFactory
: Injectors are created by an implementation of the InjectorFactory
which
creates injectors based on the class.InjectorBuilder
: Implementations must make their InjectorFactory
available through the ServiceLoader
mechanism.
Class overview
|
|||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |