public class StaticInjector extends Object implements Injector
A Grapht injector that uses a precomputed graph.
| Constructor and Description |
|---|
StaticInjector(DAGNode<Component,Dependency> g)
Create a new static injector.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected void |
finalize() |
<T> T |
getInstance(Annotation qualifier,
Class<T> type) |
<T> T |
getInstance(Class<T> type) |
<T> T |
tryGetInstance(Annotation qualifier,
Class<T> type) |
<T> T |
tryGetInstance(Class<? extends Annotation> qual,
Class<T> type) |
<T> T |
tryGetInstance(Class<T> type) |
<T> T |
tryGetInstance(QualifierMatcher qmatch,
Class<T> type) |
public StaticInjector(DAGNode<Component,Dependency> g)
Create a new static injector.
g - The object graph.public <T> T getInstance(Class<T> type) throws InjectionException
getInstance in interface InjectorInjectionExceptionpublic <T> T tryGetInstance(Class<? extends Annotation> qual, Class<T> type) throws InjectionException
InjectionExceptionpublic <T> T tryGetInstance(QualifierMatcher qmatch, Class<T> type) throws InjectionException
InjectionException@Nullable public <T> T tryGetInstance(Class<T> type) throws InjectionException
InjectionException@Nullable public <T> T tryGetInstance(Annotation qualifier, Class<T> type) throws InjectionException
tryGetInstance in interface InjectorInjectionExceptionpublic <T> T getInstance(Annotation qualifier, Class<T> type) throws InjectionException
getInstance in interface InjectorInjectionExceptionpublic void close()
close in interface AutoCloseableclose in interface Injector