final class InternalContext
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
InternalContext.DependencyStack
Keeps track of the hierarchy of types needed during injection.
|
Modifier and Type | Field and Description |
---|---|
private java.util.Map<java.lang.Object,ConstructionContext<?>> |
constructionContexts |
private Dependency<?> |
dependency
Keeps track of the type that is currently being requested for injection.
|
private InjectorImpl.InjectorOptions |
options |
private InternalContext.DependencyStack |
state
Keeps track of the hierarchy of types needed during injection.
|
Constructor and Description |
---|
InternalContext(InjectorImpl.InjectorOptions options) |
Modifier and Type | Method and Description |
---|---|
<T> ConstructionContext<T> |
getConstructionContext(java.lang.Object key) |
Dependency<?> |
getDependency() |
java.util.List<DependencyAndSource> |
getDependencyChain()
Returns the current dependency chain (all the state).
|
InjectorImpl.InjectorOptions |
getInjectorOptions() |
void |
popState()
Pops from the state without setting a dependency.
|
void |
popStateAndSetDependency(Dependency<?> newDependency)
Pops the current state & sets the new dependency.
|
Dependency<?> |
pushDependency(Dependency<?> dependency,
java.lang.Object source)
Sets the new current dependency & adds it to the state.
|
void |
pushState(Key<?> key,
java.lang.Object source)
Adds to the state without setting the dependency.
|
private final InjectorImpl.InjectorOptions options
private java.util.Map<java.lang.Object,ConstructionContext<?>> constructionContexts
private Dependency<?> dependency
private final InternalContext.DependencyStack state
InternalContext(InjectorImpl.InjectorOptions options)
public InjectorImpl.InjectorOptions getInjectorOptions()
public <T> ConstructionContext<T> getConstructionContext(java.lang.Object key)
public Dependency<?> getDependency()
public Dependency<?> pushDependency(Dependency<?> dependency, java.lang.Object source)
public void popStateAndSetDependency(Dependency<?> newDependency)
public void pushState(Key<?> key, java.lang.Object source)
public void popState()
public java.util.List<DependencyAndSource> getDependencyChain()