Top Description Fields Constructors Methods
com.google.inject.internal

pack-priv final Class BoundProviderFactory<T>

extends ProviderInternalFactory<T>
implements CreationListener
Class Inheritance
All Implemented Interfaces
com.google.inject.internal.CreationListener
Imports
com.google.inject.Key, com.google.inject.internal.InjectorImpl.JitLimitation, com.google.inject.spi.Dependency, jakarta.inject.Provider

Delegates to a custom factory which is also bound in the injector.

Field Summary

Modifier and TypeField and Description
private final InjectorImpl
private InternalFactory<? extends Provider<? extends T>>
pack-priv final Key<? extends Provider<? extends T>>
private final ProvisionListenerStackCallback<T>
Inherited from com.google.inject.internal.ProviderInternalFactory:
source

Constructor Summary

AccessConstructor and Description
pack-priv
BoundProviderFactory(InjectorImpl injector, Key<? extends Provider<? extends T>> providerKey, Object source, ProvisionListenerStackCallback<T> provisionCallback)

Method Summary

Modifier and TypeMethod and Description
public T
get(InternalContext
of this injection
context
,
Dependency<?> dependency, boolean
true if getting as a result of a linked binding
linked
)

Implements com.google.inject.internal.InternalFactory.get.

Creates an object to be injected.
public void
notify(Errors errors)

Implements com.google.inject.internal.CreationListener.notify.

Notifies that creation should happen.
protected T
provision(Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext)

Overrides com.google.inject.internal.ProviderInternalFactory.provision.

Provisions a new instance.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from com.google.inject.internal.ProviderInternalFactory:
circularGet

Field Detail

injectorback to summary
private final InjectorImpl injector
providerFactoryback to summary
private InternalFactory<? extends Provider<? extends T>> providerFactory
providerKeyback to summary
pack-priv final Key<? extends Provider<? extends T>> providerKey
provisionCallbackback to summary
private final ProvisionListenerStackCallback<T> provisionCallback

Constructor Detail

BoundProviderFactoryback to summary
pack-priv BoundProviderFactory(InjectorImpl injector, Key<? extends Provider<? extends T>> providerKey, Object source, ProvisionListenerStackCallback<T> provisionCallback)

Method Detail

getback to summary
public T get(InternalContext context, Dependency<?> dependency, boolean linked) throws InternalProvisionException

Implements com.google.inject.internal.InternalFactory.get.

Doc from com.google.inject.internal.InternalFactory.get.

Creates an object to be injected.

Parameters
context:InternalContext

of this injection

linked:boolean

true if getting as a result of a linked binding

Returns:T

instance that was created

Annotations
@Override
Exceptions
InternalProvisionException:
if a value cannot be provided
notifyback to summary
public void notify(Errors errors)

Implements com.google.inject.internal.CreationListener.notify.

Doc from com.google.inject.internal.CreationListener.notify.

Notifies that creation should happen.

Annotations
@Override
provisionback to summary
protected T provision(Provider<? extends T> provider, Dependency<?> dependency, ConstructionContext<T> constructionContext) throws InternalProvisionException

Overrides com.google.inject.internal.ProviderInternalFactory.provision.

Doc from com.google.inject.internal.ProviderInternalFactory.provision.

Provisions a new instance. Subclasses should override this to catch exceptions and rethrow as ErrorsExceptions.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override