Package com.google.inject.spi
Class InjectionPoint.OverrideIndex
java.lang.Object
com.google.inject.spi.InjectionPoint.OverrideIndex
- Enclosing class:
InjectionPoint
Keeps track of injectable methods so we can remove methods that get overridden in O(1) time.
Uses our position in the type hierarchy to perform optimizations.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) Map
<InjectionPoint.Signature, List<InjectionPoint.InjectableMethod>> (package private) final InjectionPoint.InjectableMembers
(package private) Method
(package private) InjectionPoint.Signature
(package private) InjectionPoint.Position
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void
add
(InjectionPoint.InjectableMethod injectableMethod) Adds the given method to the list of injection points.(package private) boolean
removeIfOverriddenBy
(Method method, boolean alwaysRemove, InjectionPoint.InjectableMethod injectableMethod) Removes a method overridden by the given method, if present.
-
Field Details
-
injectableMembers
-
bySignature
Map<InjectionPoint.Signature,List<InjectionPoint.InjectableMethod>> bySignature -
position
InjectionPoint.Position position -
lastMethod
Method lastMethod -
lastSignature
InjectionPoint.Signature lastSignature
-
-
Constructor Details
-
OverrideIndex
OverrideIndex(InjectionPoint.InjectableMembers injectableMembers)
-
-
Method Details
-
removeIfOverriddenBy
boolean removeIfOverriddenBy(Method method, boolean alwaysRemove, InjectionPoint.InjectableMethod injectableMethod) Removes a method overridden by the given method, if present. In order to remain backwards compatible with prior Guice versions, this will *not* remove overridden methods if 'alwaysRemove' is false and the overridden signature was annotated with a com.google.inject.Inject.- Parameters:
method
- The method used to determine what is overridden and should be removed.alwaysRemove
- true if overridden methods should be removed even if they were guice @InjectinjectableMethod
- if this method overrode any guice @Inject methods,InjectionPoint.InjectableMethod.overrodeGuiceInject
is set to true
-
add
Adds the given method to the list of injection points. Keeps track of it in this index in case it gets overridden.
-