Package com.google.inject.internal
Class BoundProviderFactory<T>
java.lang.Object
com.google.inject.internal.ProviderInternalFactory<T>
com.google.inject.internal.BoundProviderFactory<T>
- All Implemented Interfaces:
CreationListener
,InternalFactory<T>
Delegates to a custom factory which is also bound in the injector.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final InjectorImpl
private InternalFactory<? extends javax.inject.Provider<? extends T>>
private final ProvisionListenerStackCallback<T>
Fields inherited from class com.google.inject.internal.ProviderInternalFactory
source
-
Constructor Summary
ConstructorsConstructorDescriptionBoundProviderFactory
(InjectorImpl injector, Key<? extends javax.inject.Provider<? extends T>> providerKey, Object source, ProvisionListenerStackCallback<T> provisionCallback) -
Method Summary
Modifier and TypeMethodDescriptionget
(InternalContext context, Dependency<?> dependency, boolean linked) Creates an object to be injected.void
Notifies that creation should happen.protected T
provision
(javax.inject.Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) Provisions a new instance.toString()
Methods inherited from class com.google.inject.internal.ProviderInternalFactory
circularGet
-
Field Details
-
provisionCallback
-
injector
-
providerKey
-
providerFactory
-
-
Constructor Details
-
BoundProviderFactory
BoundProviderFactory(InjectorImpl injector, Key<? extends javax.inject.Provider<? extends T>> providerKey, Object source, ProvisionListenerStackCallback<T> provisionCallback)
-
-
Method Details
-
notify
Description copied from interface:CreationListener
Notifies that creation should happen.- Specified by:
notify
in interfaceCreationListener
-
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
-
toString
-