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

pack-priv final Class FactoryProxy<T>

extends Object
implements InternalFactory<T>, CreationListener
Class Inheritance
All Implemented Interfaces
com.google.inject.internal.CreationListener, com.google.inject.internal.InternalFactory
Imports
com.google.common.base.MoreObjects, com.google.inject.Key, com.google.inject.internal.InjectorImpl.JitLimitation, com.google.inject.spi.Dependency

A placeholder which enables us to swap in the real factory once the injector is created. Used for a linked binding, so that getting the linked binding returns the link's factory.

Field Summary

Modifier and TypeField and Description
private final InjectorImpl
private final Key<T>
private final Object
private InternalFactory<? extends T>
private final Key<? extends T>

Constructor Summary

AccessConstructor and Description
pack-priv
FactoryProxy(InjectorImpl injector, Key<T> key, Key<? extends T> targetKey, Object source)

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(final Errors errors)

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

Notifies that creation should happen.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

injectorback to summary
private final InjectorImpl injector
keyback to summary
private final Key<T> key
sourceback to summary
private final Object source
targetFactoryback to summary
private InternalFactory<? extends T> targetFactory
targetKeyback to summary
private final Key<? extends T> targetKey

Constructor Detail

FactoryProxyback to summary
pack-priv FactoryProxy(InjectorImpl injector, Key<T> key, Key<? extends T> targetKey, Object source)

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(final Errors errors)

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

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

Notifies that creation should happen.

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