Package com.google.inject.internal
Interface State
- All Known Implementing Classes:
InheritingState
interface State
The inheritable data within an injector. This class is intended to allow parent and local
injector data to be accessed as a unit.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConverter
(TypeConverterBinding typeConverterBinding) void
addProvisionListener
(ProvisionListenerBinding provisionListenerBinding) void
void
addTypeListener
(TypeListenerBinding typeListenerBinding) 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> scopingAnnotation) 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
-
NONE
-
-
Method Details
-
parent
State parent() -
getExplicitBinding
Gets a binding which was specified explicitly in a module, or null. -
getExplicitBindingsThisLevel
Returns the explicit bindings at this level only. -
putBinding
-
putProviderLookup
-
getProviderLookupsThisLevel
Set<ProviderLookup<?>> getProviderLookupsThisLevel() -
putStaticInjectionRequest
-
getStaticInjectionRequestsThisLevel
Set<StaticInjectionRequest> getStaticInjectionRequestsThisLevel() -
getScopeBinding
-
putInjectionRequest
-
getInjectionRequestsThisLevel
Set<InjectionRequest<?>> getInjectionRequestsThisLevel() -
putMembersInjectorLookup
-
getMembersInjectorLookupsThisLevel
Set<MembersInjectorLookup<?>> getMembersInjectorLookupsThisLevel() -
putScopeBinding
-
getScopeBindingsThisLevel
Collection<ScopeBinding> getScopeBindingsThisLevel() -
addConverter
-
getConverter
TypeConverterBinding getConverter(String stringValue, TypeLiteral<?> type, Errors errors, Object source) Returns the matching converter fortype
, or null if none match. -
getConvertersThisLevel
Iterable<TypeConverterBinding> getConvertersThisLevel()Returns all converters at this level only. -
addTypeListener
-
getTypeListenerBindings
List<TypeListenerBinding> getTypeListenerBindings() -
getTypeListenerBindingsThisLevel
List<TypeListenerBinding> getTypeListenerBindingsThisLevel() -
addProvisionListener
-
getProvisionListenerBindings
List<ProvisionListenerBinding> getProvisionListenerBindings() -
getProvisionListenerBindingsThisLevel
List<ProvisionListenerBinding> getProvisionListenerBindingsThisLevel() -
addScanner
-
getScannerBindings
List<ModuleAnnotatedMethodScannerBinding> getScannerBindings() -
getScannerBindingsThisLevel
List<ModuleAnnotatedMethodScannerBinding> getScannerBindingsThisLevel() -
blacklist
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
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. -
getSourcesForBlacklistedKey
Returns the source of a blacklisted key. -
lock
Object lock()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
Map<Class<? extends Annotation>,Scope> getScopes()Returns all the scope bindings at this level and parent levels.
-