Package com.google.inject.internal
Class ExposedKeyFactory<T>
- java.lang.Object
-
- com.google.inject.internal.ExposedKeyFactory<T>
-
- All Implemented Interfaces:
CreationListener
,InternalFactory<T>
final class ExposedKeyFactory<T> extends java.lang.Object implements InternalFactory<T>, CreationListener
This factory exists in a parent injector. When invoked, it retrieves its value from a child injector.
-
-
Field Summary
Fields Modifier and Type Field Description private BindingImpl<T>
delegate
private Key<T>
key
private PrivateElements
privateElements
-
Constructor Summary
Constructors Constructor Description ExposedKeyFactory(Key<T> key, PrivateElements privateElements)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description T
get(InternalContext context, Dependency<?> dependency, boolean linked)
Creates an object to be injected.void
notify(Errors errors)
Notifies that creation should happen.
-
-
-
Field Detail
-
privateElements
private final PrivateElements privateElements
-
delegate
private BindingImpl<T> delegate
-
-
Constructor Detail
-
ExposedKeyFactory
ExposedKeyFactory(Key<T> key, PrivateElements privateElements)
-
-
Method Detail
-
notify
public void notify(Errors errors)
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
-
-