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 InjectorImplprivate 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.voidNotifies that creation should happen.protected Tprovision(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:CreationListenerNotifies that creation should happen.- Specified by:
notifyin interfaceCreationListener
-
get
public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException Description copied from interface:InternalFactoryCreates an object to be injected.- Specified by:
getin 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:ProviderInternalFactoryProvisions a new instance. Subclasses should override this to catch exceptions & rethrow as ErrorsExceptions.- Overrides:
provisionin classProviderInternalFactory<T>- Throws:
InternalProvisionException
-
toString
-