Initializable, which attempts to perform injection before use.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private final CycleDetectingLock. | cycleDetectingLockFactory
Allows us to detect circular dependencies. |
| private final IdentityHashMap | initializablesCache
Map that guarantees that no instance would get two references. |
| private final List | pendingInjections
Instances that need injection during injector creation to a source that registered them. |
| private volatile boolean | validationStarted
Is set to true once |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv void | |
| pack-priv <T> Initializable | requestInjection(InjectorImpl injector, TypeLiteral<T> type, T
an instance that optionally has members to be injected (each annotated
with @Inject). instance, Binding<T> the binding that caused this initializable to be created, if it exists. binding, Object the source location that this injection was requested source, Set<InjectionPoint> injectionPoints, Errors errors)Registers an instance for member injection when that step is performed. |
| pack-priv void |
| cycleDetectingLockFactory | back to summary |
|---|---|
| private final CycleDetectingLock. Allows us to detect circular dependencies. It's only used during injectable reference initialization. After initialization direct access through volatile field is used. | |
| initializablesCache | back to summary |
|---|---|
| private final IdentityHashMap<Object, Initializer. Map that guarantees that no instance would get two references. New references added before
| |
| pendingInjections | back to summary |
|---|---|
| private final List<Initializer. Instances that need injection during injector creation to a source that registered them. New
references added before | |
| validationStarted | back to summary |
|---|---|
| private volatile boolean validationStarted Is set to true once | |
| Initializer | back to summary |
|---|---|
| pack-priv Initializer() | |
| injectAll | back to summary |
|---|---|
| pack-priv void injectAll(final Errors errors) Performs creation-time injections on all objects that require it. Whenever fulfilling an injection depends on another object that requires injection, we inject it first. If the two instances are codependent (directly or transitively), ordering of injection is arbitrary. | |
| requestInjection | back to summary |
|---|---|
| pack-priv <T> Initializable Registers an instance for member injection when that step is performed. | |
| validateOustandingInjections | back to summary |
|---|---|
| pack-priv void validateOustandingInjections(Errors errors) Prepares member injectors for all injected instances. This prompts Guice to do static analysis on the injected instances. | |
| Modifier and Type | Field and Description |
|---|---|
| private final InjectorImpl | |
| private final T | |
| private final Key | |
| private final CycleDetectingLock | |
| private volatile MembersInjectorImpl | |
| private final ProvisionListenerStackCallback | |
| private final Object | |
| private volatile Initializer. | |
| private final TypeLiteral |
| Access | Constructor and Description |
|---|---|
| public | InjectableReference(InjectorImpl injector, T instance, TypeLiteral<T> type, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, Object source, CycleDetectingLock<?> lock)
|
| Modifier and Type | Method and Description |
|---|---|
| public T | |
| public String | |
| public void |
| injector | back to summary |
|---|---|
| private final InjectorImpl injector | |
| instance | back to summary |
|---|---|
| private final T instance | |
| key | back to summary |
|---|---|
| private final Key<T> key | |
| lock | back to summary |
|---|---|
| private final CycleDetectingLock<?> lock | |
| membersInjector | back to summary |
|---|---|
| private volatile MembersInjectorImpl<T> membersInjector | |
| provisionCallback | back to summary |
|---|---|
| private final ProvisionListenerStackCallback<T> provisionCallback | |
| source | back to summary |
|---|---|
| private final Object source | |
| state | back to summary |
|---|---|
| private volatile Initializer. | |
| type | back to summary |
|---|---|
| private final TypeLiteral<T> type | |
| InjectableReference | back to summary |
|---|---|
| public InjectableReference(InjectorImpl injector, T instance, TypeLiteral<T> type, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, Object source, CycleDetectingLock<?> lock) | |
| get | back to summary |
|---|---|
| public T get() throws InternalProvisionException Implements com. Reentrant. If
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| validate | back to summary |
|---|---|
| public void validate(Errors errors) throws ErrorsException | |
| Modifier and Type | Field and Description |
|---|---|
| public static final Initializer. | |
| public static final Initializer. | |
| public static final Initializer. | |
| public static final Initializer. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Initializer. | |
| public static Initializer. |
| INJECTING | back to summary |
|---|---|
| public static final Initializer. | |
| NEW | back to summary |
|---|---|
| public static final Initializer. | |
| READY | back to summary |
|---|---|
| public static final Initializer. | |
| VALIDATED | back to summary |
|---|---|
| public static final Initializer. | |
| InjectableReferenceState | back to summary |
|---|---|
| private InjectableReferenceState() | |
| valueOf | back to summary |
|---|---|
| public static Initializer. | |
| values | back to summary |
|---|---|
| public static Initializer. | |