Package com.google.inject.internal
Class ProvidedByInternalFactory<T>
java.lang.Object
com.google.inject.internal.ProviderInternalFactory<T>
com.google.inject.internal.ProvidedByInternalFactory<T>
- All Implemented Interfaces:
DelayedInitialize
,InternalFactory<T>
An
InternalFactory
for @ProvidedBy
bindings.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BindingImpl<? extends javax.inject.Provider<T>>
private final Class<? extends javax.inject.Provider<?>>
private ProvisionListenerStackCallback<T>
private final Class<?>
Fields inherited from class com.google.inject.internal.ProviderInternalFactory
source
-
Constructor Summary
ConstructorsConstructorDescriptionProvidedByInternalFactory
(Class<?> rawType, Class<? extends javax.inject.Provider<?>> providerType, Key<? extends javax.inject.Provider<T>> providerKey) -
Method Summary
Modifier and TypeMethodDescriptionget
(InternalContext context, Dependency<?> dependency, boolean linked) Creates an object to be injected.void
initialize
(InjectorImpl injector, Errors errors) Initializes this binding, throwing any errors if necessary.protected T
provision
(javax.inject.Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) Provisions a new instance.(package private) void
Methods inherited from class com.google.inject.internal.ProviderInternalFactory
circularGet
-
Field Details
-
rawType
-
providerType
-
providerKey
-
providerBinding
-
provisionCallback
-
-
Constructor Details
-
ProvidedByInternalFactory
-
-
Method Details
-
setProvisionListenerCallback
-
initialize
Description copied from interface:DelayedInitialize
Initializes this binding, throwing any errors if necessary.- Specified by:
initialize
in interfaceDelayedInitialize
- Throws:
ErrorsException
-
get
public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException Description copied from interface:InternalFactory
Creates an object to be injected.- Specified by:
get
in interfaceInternalFactory<T>
- Parameters:
context
- of this injectionlinked
- true if getting as a result of a linked binding- Returns:
- instance that was created
- Throws:
InternalProvisionException
- if a value cannot be provided
-
provision
protected T provision(javax.inject.Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException Description copied from class:ProviderInternalFactory
Provisions a new instance. Subclasses should override this to catch exceptions & rethrow as ErrorsExceptions.- Overrides:
provision
in classProviderInternalFactory<T>
- Throws:
InternalProvisionException
-