Package com.google.inject.internal
Interface State
-
- All Known Implementing Classes:
InheritingState
interface StateThe inheritable data within an injector. This class is intended to allow parent and local injector data to be accessed as a unit.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddConverter(TypeConverterBinding typeConverterBinding)voidaddProvisionListener(ProvisionListenerBinding provisionListenerBinding)voidaddScanner(ModuleAnnotatedMethodScannerBinding scanner)voidaddTypeListener(TypeListenerBinding typeListenerBinding)voidblacklist(Key<?> key, State state, java.lang.Object source)Forbids the corresponding injector from creating a binding tokey.TypeConverterBindinggetConverter(java.lang.String stringValue, TypeLiteral<?> type, Errors errors, java.lang.Object source)Returns the matching converter fortype, or null if none match.java.lang.Iterable<TypeConverterBinding>getConvertersThisLevel()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.java.util.Map<Key<?>,Binding<?>>getExplicitBindingsThisLevel()Returns the explicit bindings at this level only.java.util.Set<InjectionRequest<?>>getInjectionRequestsThisLevel()java.util.Set<MembersInjectorLookup<?>>getMembersInjectorLookupsThisLevel()java.util.Set<ProviderLookup<?>>getProviderLookupsThisLevel()java.util.List<ProvisionListenerBinding>getProvisionListenerBindings()java.util.List<ProvisionListenerBinding>getProvisionListenerBindingsThisLevel()java.util.List<ModuleAnnotatedMethodScannerBinding>getScannerBindings()java.util.List<ModuleAnnotatedMethodScannerBinding>getScannerBindingsThisLevel()ScopeBindinggetScopeBinding(java.lang.Class<? extends java.lang.annotation.Annotation> scopingAnnotation)java.util.Collection<ScopeBinding>getScopeBindingsThisLevel()java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,Scope>getScopes()Returns all the scope bindings at this level and parent levels.java.util.Set<java.lang.Object>getSourcesForBlacklistedKey(Key<?> key)Returns the source of a blacklisted key.java.util.Set<StaticInjectionRequest>getStaticInjectionRequestsThisLevel()java.util.List<TypeListenerBinding>getTypeListenerBindings()java.util.List<TypeListenerBinding>getTypeListenerBindingsThisLevel()booleanisBlacklisted(Key<?> key)Returns true ifkeyis forbidden from being bound in this injector.java.lang.Objectlock()Returns the shared lock for all injector data.Stateparent()voidputBinding(Key<?> key, BindingImpl<?> binding)voidputInjectionRequest(InjectionRequest<?> injectionRequest)voidputMembersInjectorLookup(MembersInjectorLookup<?> membersInjectorLookup)voidputProviderLookup(ProviderLookup<?> lookup)voidputScopeBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, ScopeBinding scope)voidputStaticInjectionRequest(StaticInjectionRequest staticInjectionRequest)
-
-
-
Field Detail
-
NONE
static final State NONE
-
-
Method Detail
-
parent
State parent()
-
getExplicitBinding
<T> BindingImpl<T> getExplicitBinding(Key<T> key)
Gets a binding which was specified explicitly in a module, or null.
-
getExplicitBindingsThisLevel
java.util.Map<Key<?>,Binding<?>> getExplicitBindingsThisLevel()
Returns the explicit bindings at this level only.
-
putBinding
void putBinding(Key<?> key, BindingImpl<?> binding)
-
putProviderLookup
void putProviderLookup(ProviderLookup<?> lookup)
-
getProviderLookupsThisLevel
java.util.Set<ProviderLookup<?>> getProviderLookupsThisLevel()
-
putStaticInjectionRequest
void putStaticInjectionRequest(StaticInjectionRequest staticInjectionRequest)
-
getStaticInjectionRequestsThisLevel
java.util.Set<StaticInjectionRequest> getStaticInjectionRequestsThisLevel()
-
getScopeBinding
ScopeBinding getScopeBinding(java.lang.Class<? extends java.lang.annotation.Annotation> scopingAnnotation)
-
putInjectionRequest
void putInjectionRequest(InjectionRequest<?> injectionRequest)
-
getInjectionRequestsThisLevel
java.util.Set<InjectionRequest<?>> getInjectionRequestsThisLevel()
-
putMembersInjectorLookup
void putMembersInjectorLookup(MembersInjectorLookup<?> membersInjectorLookup)
-
getMembersInjectorLookupsThisLevel
java.util.Set<MembersInjectorLookup<?>> getMembersInjectorLookupsThisLevel()
-
putScopeBinding
void putScopeBinding(java.lang.Class<? extends java.lang.annotation.Annotation> annotationType, ScopeBinding scope)
-
getScopeBindingsThisLevel
java.util.Collection<ScopeBinding> getScopeBindingsThisLevel()
-
addConverter
void addConverter(TypeConverterBinding typeConverterBinding)
-
getConverter
TypeConverterBinding getConverter(java.lang.String stringValue, TypeLiteral<?> type, Errors errors, java.lang.Object source)
Returns the matching converter fortype, or null if none match.
-
getConvertersThisLevel
java.lang.Iterable<TypeConverterBinding> getConvertersThisLevel()
Returns all converters at this level only.
-
addTypeListener
void addTypeListener(TypeListenerBinding typeListenerBinding)
-
getTypeListenerBindings
java.util.List<TypeListenerBinding> getTypeListenerBindings()
-
getTypeListenerBindingsThisLevel
java.util.List<TypeListenerBinding> getTypeListenerBindingsThisLevel()
-
addProvisionListener
void addProvisionListener(ProvisionListenerBinding provisionListenerBinding)
-
getProvisionListenerBindings
java.util.List<ProvisionListenerBinding> getProvisionListenerBindings()
-
getProvisionListenerBindingsThisLevel
java.util.List<ProvisionListenerBinding> getProvisionListenerBindingsThisLevel()
-
addScanner
void addScanner(ModuleAnnotatedMethodScannerBinding scanner)
-
getScannerBindings
java.util.List<ModuleAnnotatedMethodScannerBinding> getScannerBindings()
-
getScannerBindingsThisLevel
java.util.List<ModuleAnnotatedMethodScannerBinding> getScannerBindingsThisLevel()
-
blacklist
void blacklist(Key<?> key, State state, java.lang.Object source)
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
boolean isBlacklisted(Key<?> key)
Returns true ifkeyis forbidden from being bound in this injector. This indicates that one of this injector's descendent's has bound the key.
-
getSourcesForBlacklistedKey
java.util.Set<java.lang.Object> getSourcesForBlacklistedKey(Key<?> key)
Returns the source of a blacklisted key.
-
lock
java.lang.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
java.util.Map<java.lang.Class<? extends java.lang.annotation.Annotation>,Scope> getScopes()
Returns all the scope bindings at this level and parent levels.
-
-