Package com.google.inject.internal
Class InheritingState
java.lang.Object
com.google.inject.internal.InheritingState
- All Implemented Interfaces:
State
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final WeakKeySet
private final List<TypeConverterBinding>
private final Set<InjectionRequest<?>>
private final Object
private final Set<MembersInjectorLookup<?>>
private final State
private final Set<ProviderLookup<?>>
private final List<ProvisionListenerBinding>
private final List<ModuleAnnotatedMethodScannerBinding>
private final Map<Class<? extends Annotation>,
ScopeBinding> private final Set<StaticInjectionRequest>
private final List<TypeListenerBinding>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConverter
(TypeConverterBinding typeConverterBinding) void
addProvisionListener
(ProvisionListenerBinding listenerBinding) void
void
addTypeListener
(TypeListenerBinding listenerBinding) void
Forbids the corresponding injector from creating a binding tokey
.getConverter
(String stringValue, TypeLiteral<?> type, Errors errors, Object source) Returns the matching converter fortype
, or null if none match.Returns all converters at this level only.<T> BindingImpl<T>
getExplicitBinding
(Key<T> key) Gets a binding which was specified explicitly in a module, or null.Returns the explicit bindings at this level only.Set<InjectionRequest<?>>
Set<ProviderLookup<?>>
getScopeBinding
(Class<? extends Annotation> annotationType) Map<Class<? extends Annotation>,
Scope> Returns all the scope bindings at this level and parent levels.getSourcesForBlacklistedKey
(Key<?> key) Returns the source of a blacklisted key.boolean
isBlacklisted
(Key<?> key) Returns true ifkey
is forbidden from being bound in this injector.lock()
Returns the shared lock for all injector data.parent()
void
putBinding
(Key<?> key, BindingImpl<?> binding) void
putInjectionRequest
(InjectionRequest<?> injectionRequest) void
putMembersInjectorLookup
(MembersInjectorLookup<?> membersInjectorLookup) void
putProviderLookup
(ProviderLookup<?> lookup) void
putScopeBinding
(Class<? extends Annotation> annotationType, ScopeBinding scope) void
putStaticInjectionRequest
(StaticInjectionRequest staticInjectionRequest)
-
Field Details
-
parent
-
explicitBindingsMutable
-
explicitBindings
-
scopes
-
providerLookups
-
staticInjectionRequests
-
membersInjectorLookups
-
injectionRequests
-
converters
-
typeListenerBindings
-
provisionListenerBindings
-
scannerBindings
-
blacklistedKeys
-
lock
-
-
Constructor Details
-
InheritingState
InheritingState(State parent)
-
-
Method Details
-
parent
-
getExplicitBinding
Description copied from interface:State
Gets a binding which was specified explicitly in a module, or null.- Specified by:
getExplicitBinding
in interfaceState
-
getExplicitBindingsThisLevel
Description copied from interface:State
Returns the explicit bindings at this level only.- Specified by:
getExplicitBindingsThisLevel
in interfaceState
-
putBinding
- Specified by:
putBinding
in interfaceState
-
putProviderLookup
- Specified by:
putProviderLookup
in interfaceState
-
getProviderLookupsThisLevel
- Specified by:
getProviderLookupsThisLevel
in interfaceState
-
putStaticInjectionRequest
- Specified by:
putStaticInjectionRequest
in interfaceState
-
getStaticInjectionRequestsThisLevel
- Specified by:
getStaticInjectionRequestsThisLevel
in interfaceState
-
putInjectionRequest
- Specified by:
putInjectionRequest
in interfaceState
-
getInjectionRequestsThisLevel
- Specified by:
getInjectionRequestsThisLevel
in interfaceState
-
putMembersInjectorLookup
- Specified by:
putMembersInjectorLookup
in interfaceState
-
getMembersInjectorLookupsThisLevel
- Specified by:
getMembersInjectorLookupsThisLevel
in interfaceState
-
getScopeBinding
- Specified by:
getScopeBinding
in interfaceState
-
putScopeBinding
- Specified by:
putScopeBinding
in interfaceState
-
getScopeBindingsThisLevel
- Specified by:
getScopeBindingsThisLevel
in interfaceState
-
getConvertersThisLevel
Description copied from interface:State
Returns all converters at this level only.- Specified by:
getConvertersThisLevel
in interfaceState
-
addConverter
- Specified by:
addConverter
in interfaceState
-
getConverter
public TypeConverterBinding getConverter(String stringValue, TypeLiteral<?> type, Errors errors, Object source) Description copied from interface:State
Returns the matching converter fortype
, or null if none match.- Specified by:
getConverter
in interfaceState
-
addTypeListener
- Specified by:
addTypeListener
in interfaceState
-
getTypeListenerBindings
- Specified by:
getTypeListenerBindings
in interfaceState
-
getTypeListenerBindingsThisLevel
- Specified by:
getTypeListenerBindingsThisLevel
in interfaceState
-
addProvisionListener
- Specified by:
addProvisionListener
in interfaceState
-
getProvisionListenerBindings
- Specified by:
getProvisionListenerBindings
in interfaceState
-
getProvisionListenerBindingsThisLevel
- Specified by:
getProvisionListenerBindingsThisLevel
in interfaceState
-
addScanner
- Specified by:
addScanner
in interfaceState
-
getScannerBindings
- Specified by:
getScannerBindings
in interfaceState
-
getScannerBindingsThisLevel
- Specified by:
getScannerBindingsThisLevel
in interfaceState
-
blacklist
Description copied from interface:State
Forbids the corresponding injector from creating a binding tokey
. Child injectors blacklist their bound keys on their parent injectors to prevent just-in-time bindings on the parent injector that would conflict and pass along their state to control the lifetimes. -
isBlacklisted
Description copied from interface:State
Returns true ifkey
is forbidden from being bound in this injector. This indicates that one of this injector's descendent's has bound the key.- Specified by:
isBlacklisted
in interfaceState
-
getSourcesForBlacklistedKey
Description copied from interface:State
Returns the source of a blacklisted key.- Specified by:
getSourcesForBlacklistedKey
in interfaceState
-
lock
Description copied from interface:State
Returns the shared lock for all injector data. This is a low-granularity, high-contention lock to be used when reading mutable data (ie. just-in-time bindings, and binding blacklists). -
getScopes
Description copied from interface:State
Returns all the scope bindings at this level and parent levels.
-