Package io.bootique.di.spi
Class DICollectionBuilder<K,E>
java.lang.Object
io.bootique.di.spi.DICollectionBuilder<K,E>
- Type Parameters:
K- DI key type.E- Collection element type.
- All Implemented Interfaces:
ScopeBuilder
A superclass of DI List and Map builders.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected javax.inject.Provider<E>createInstanceProvider(E value) protected javax.inject.Provider<E>createProviderProvider(Class<? extends javax.inject.Provider<? extends E>> providerType) protected <SubT extends E>
javax.inject.Provider<SubT>getByKeyProvider(Key<SubT> key) protected <SubT extends E>
javax.inject.Provider<SubT>getByTypeProvider(Class<SubT> interfaceType) voidSets the scope of a bound instance.voidMarks this injection point to be triggered early without explicit call toInjector.getInstance(Class).voidSets the scope of a bound instance to singleton.voidSets the scope of a bound instance to "no scope".
-
Field Details
-
injector
-
bindingKey
-
-
Constructor Details
-
DICollectionBuilder
-
-
Method Details
-
createInstanceProvider
-
createProviderProvider
-
getByTypeProvider
-
getByKeyProvider
-
in
Description copied from interface:ScopeBuilderSets the scope of a bound instance. This method is used to change the default scope which is a singleton by default to a custom scope.- Specified by:
inin interfaceScopeBuilder
-
inSingletonScope
public void inSingletonScope()Description copied from interface:ScopeBuilderSets the scope of a bound instance to singleton. Singleton is normally the default.- Specified by:
inSingletonScopein interfaceScopeBuilder
-
withoutScope
public void withoutScope()Description copied from interface:ScopeBuilderSets the scope of a bound instance to "no scope". This means that a new instance of an object will be created on every call toInjector.getInstance(Class)or toProviderof this instance.- Specified by:
withoutScopein interfaceScopeBuilder
-
initOnStartup
public void initOnStartup()Description copied from interface:ScopeBuilderMarks this injection point to be triggered early without explicit call toInjector.getInstance(Class). Such service will be created right afterInjectoris fully setup. NOTE: use with caution, as this will effectively create all graph of services that this service depends on.- Specified by:
initOnStartupin interfaceScopeBuilder
-