public class CacheDependencySource extends java.lang.Object implements DependencySource
Constructor and Description |
---|
CacheDependencySource() |
Modifier and Type | Method and Description |
---|---|
void |
addToCache(java.lang.Class<?> dependency,
java.lang.Object instance) |
int |
getPriority()
Dependency sources are called in ascending order
based of their priority.
|
boolean |
injectRecursively()
Indicates if the last returned dependency should
have its fields be resolved by the dependency injector
or not.
|
<T> java.lang.Object |
resolve(java.lang.Class<T> dependency)
Resolves given dependency (if possible).
|
public void addToCache(java.lang.Class<?> dependency, java.lang.Object instance)
public <T> java.lang.Object resolve(java.lang.Class<T> dependency)
DependencySource
resolve
in interface DependencySource
T
- the type to resolvedependency
- The class of the dependency to resolvepublic int getPriority()
DependencySource
Dependency sources are called in ascending order based of their priority. The first dependency source that resolves a non-null value is selected as the dependency source.
getPriority
in interface DependencySource
public boolean injectRecursively()
DependencySource
injectRecursively
in interface DependencySource