public final class InternalInjectorCreator
extends java.lang.Object
Binder.newPrivateBinder() private environment
. The primary injector is not necessarily a
top-level injector.
Injector construction happens in two phases.
the tool stage
Modifier and Type | Class and Description |
---|---|
(package private) static class |
InternalInjectorCreator.ToolStageInjector
Injector exposed to users in Stage.TOOL . |
Modifier and Type | Field and Description |
---|---|
private ProcessedBindingData |
bindingData |
private Errors |
errors |
private Initializer |
initializer |
private InjectionRequestProcessor |
injectionRequestProcessor |
private InjectorShell.Builder |
shellBuilder |
private java.util.List<InjectorShell> |
shells |
private Stopwatch |
stopwatch |
Constructor and Description |
---|
InternalInjectorCreator() |
Modifier and Type | Method and Description |
---|---|
InternalInjectorCreator |
addModules(java.lang.Iterable<? extends Module> modules) |
Injector |
build() |
private void |
initializeStatically()
Initialize and validate everything.
|
private void |
injectDynamically()
Inject everything that can be injected.
|
private boolean |
isEagerSingleton(InjectorImpl injector,
BindingImpl<?> binding,
Stage stage) |
(package private) void |
loadEagerSingletons(InjectorImpl injector,
Stage stage,
Errors errors)
Loads eager singletons, or all singletons if we're in Stage.PRODUCTION.
|
InternalInjectorCreator |
parentInjector(InjectorImpl parent)
Sets the parent of the injector to-be-constructed.
|
private Injector |
primaryInjector()
Returns the injector being constructed.
|
InternalInjectorCreator |
stage(Stage stage) |
private final Stopwatch stopwatch
private final Errors errors
private final Initializer initializer
private final ProcessedBindingData bindingData
private final InjectionRequestProcessor injectionRequestProcessor
private final InjectorShell.Builder shellBuilder
private java.util.List<InjectorShell> shells
public InternalInjectorCreator stage(Stage stage)
public InternalInjectorCreator parentInjector(InjectorImpl parent)
parent
and sets #requireExplicitBindings()
if the parent
injector also required them.public InternalInjectorCreator addModules(java.lang.Iterable<? extends Module> modules)
public Injector build()
private void initializeStatically()
private Injector primaryInjector()
private void injectDynamically()
void loadEagerSingletons(InjectorImpl injector, Stage stage, Errors errors)
private boolean isEagerSingleton(InjectorImpl injector, BindingImpl<?> binding, Stage stage)