Package com.google.inject.internal
Class MembersInjectorImpl<T>
- java.lang.Object
-
- com.google.inject.internal.MembersInjectorImpl<T>
-
- All Implemented Interfaces:
MembersInjector<T>
final class MembersInjectorImpl<T> extends java.lang.Object implements MembersInjector<T>
Injects members of instances of a given type.
-
-
Field Summary
Fields Modifier and Type Field Description private com.google.common.collect.ImmutableList<MethodAspect>
addedAspects
private com.google.common.collect.ImmutableList<InjectionListener<? super T>>
injectionListeners
private InjectorImpl
injector
private com.google.common.collect.ImmutableList<SingleMemberInjector>
memberInjectors
private TypeLiteral<T>
typeLiteral
private com.google.common.collect.ImmutableList<MembersInjector<? super T>>
userMembersInjectors
-
Constructor Summary
Constructors Constructor Description MembersInjectorImpl(InjectorImpl injector, TypeLiteral<T> typeLiteral, EncounterImpl<T> encounter, com.google.common.collect.ImmutableList<SingleMemberInjector> memberInjectors)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.google.common.collect.ImmutableList<MethodAspect>
getAddedAspects()
com.google.common.collect.ImmutableSet<InjectionPoint>
getInjectionPoints()
com.google.common.collect.ImmutableList<SingleMemberInjector>
getMemberInjectors()
(package private) void
injectAndNotify(T instance, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, java.lang.Object source, boolean toolableOnly)
void
injectMembers(T instance)
Injects dependencies into the fields and methods ofinstance
.(package private) void
injectMembers(T t, InternalContext context, boolean toolableOnly)
(package private) void
notifyListeners(T instance)
java.lang.String
toString()
-
-
-
Field Detail
-
typeLiteral
private final TypeLiteral<T> typeLiteral
-
injector
private final InjectorImpl injector
-
memberInjectors
@Nullable private final com.google.common.collect.ImmutableList<SingleMemberInjector> memberInjectors
-
userMembersInjectors
@Nullable private final com.google.common.collect.ImmutableList<MembersInjector<? super T>> userMembersInjectors
-
injectionListeners
@Nullable private final com.google.common.collect.ImmutableList<InjectionListener<? super T>> injectionListeners
-
addedAspects
@Nullable private final com.google.common.collect.ImmutableList<MethodAspect> addedAspects
-
-
Constructor Detail
-
MembersInjectorImpl
MembersInjectorImpl(InjectorImpl injector, TypeLiteral<T> typeLiteral, EncounterImpl<T> encounter, com.google.common.collect.ImmutableList<SingleMemberInjector> memberInjectors)
-
-
Method Detail
-
getMemberInjectors
public com.google.common.collect.ImmutableList<SingleMemberInjector> getMemberInjectors()
-
injectMembers
public void injectMembers(T instance)
Description copied from interface:MembersInjector
Injects dependencies into the fields and methods ofinstance
. Ignores the presence or absence of an injectable constructor.Whenever Guice creates an instance, it performs this injection automatically (after first performing constructor injection), so if you're able to let Guice create all your objects for you, you'll never need to use this method.
- Specified by:
injectMembers
in interfaceMembersInjector<T>
- Parameters:
instance
- to inject members on. May benull
.
-
injectAndNotify
void injectAndNotify(T instance, Key<T> key, ProvisionListenerStackCallback<T> provisionCallback, java.lang.Object source, boolean toolableOnly) throws InternalProvisionException
- Throws:
InternalProvisionException
-
notifyListeners
void notifyListeners(T instance) throws InternalProvisionException
- Throws:
InternalProvisionException
-
injectMembers
void injectMembers(T t, InternalContext context, boolean toolableOnly) throws InternalProvisionException
- Throws:
InternalProvisionException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getInjectionPoints
public com.google.common.collect.ImmutableSet<InjectionPoint> getInjectionPoints()
-
getAddedAspects
public com.google.common.collect.ImmutableList<MethodAspect> getAddedAspects()
-
-