Package com.google.inject.internal
Class MembersInjectorStore
- java.lang.Object
-
- com.google.inject.internal.MembersInjectorStore
-
final class MembersInjectorStore extends java.lang.Object
Members injectors by type.
-
-
Field Summary
Fields Modifier and Type Field Description private FailableCache<TypeLiteral<?>,MembersInjectorImpl<?>>
cache
private InjectorImpl
injector
private com.google.common.collect.ImmutableList<TypeListenerBinding>
typeListenerBindings
-
Constructor Summary
Constructors Constructor Description MembersInjectorStore(InjectorImpl injector, java.util.List<TypeListenerBinding> typeListenerBindings)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private <T> MembersInjectorImpl<T>
createWithListeners(TypeLiteral<T> type, Errors errors)
Creates a new members injector and attaches both injection listeners and method aspects.<T> MembersInjectorImpl<T>
get(TypeLiteral<T> key, Errors errors)
Returns a new complete members injector with injection listeners registered.(package private) com.google.common.collect.ImmutableList<SingleMemberInjector>
getInjectors(java.util.Set<InjectionPoint> injectionPoints, Errors errors)
Returns the injectors for the specified injection points.boolean
hasTypeListeners()
Returns true if any type listeners are installed.(package private) boolean
remove(TypeLiteral<?> type)
Purges a type literal from the cache.
-
-
-
Field Detail
-
injector
private final InjectorImpl injector
-
typeListenerBindings
private final com.google.common.collect.ImmutableList<TypeListenerBinding> typeListenerBindings
-
cache
private final FailableCache<TypeLiteral<?>,MembersInjectorImpl<?>> cache
-
-
Constructor Detail
-
MembersInjectorStore
MembersInjectorStore(InjectorImpl injector, java.util.List<TypeListenerBinding> typeListenerBindings)
-
-
Method Detail
-
hasTypeListeners
public boolean hasTypeListeners()
Returns true if any type listeners are installed. Other code may take shortcuts when there aren't any type listeners.
-
get
public <T> MembersInjectorImpl<T> get(TypeLiteral<T> key, Errors errors) throws ErrorsException
Returns a new complete members injector with injection listeners registered.- Throws:
ErrorsException
-
remove
boolean remove(TypeLiteral<?> type)
Purges a type literal from the cache. Use this only if the type is not actually valid for binding and needs to be purged. (See issue 319 and ImplicitBindingTest#testCircularJitBindingsLeaveNoResidue and #testInstancesRequestingProvidersForThemselvesWithChildInjectors for examples of when this is necessary.)Returns true if the type was stored in the cache, false otherwise.
-
createWithListeners
private <T> MembersInjectorImpl<T> createWithListeners(TypeLiteral<T> type, Errors errors) throws ErrorsException
Creates a new members injector and attaches both injection listeners and method aspects.- Throws:
ErrorsException
-
getInjectors
com.google.common.collect.ImmutableList<SingleMemberInjector> getInjectors(java.util.Set<InjectionPoint> injectionPoints, Errors errors)
Returns the injectors for the specified injection points.
-
-