Package io.activej.inject.module
Class AbstractModule
java.lang.Object
io.activej.inject.module.AbstractModule
- All Implemented Interfaces:
Module
This class is an abstract module wrapper around
ModuleBuilder.
It provides functionality that is similar to some other DI frameworks for the ease of transition.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final <T> ModuleBuilder0<T>This method begins a chain of binding builder DSL callsprotected final <T> ModuleBuilder0<T>This method begins a chain of binding builder DSL calls.protected final <T> ModuleBuilder0<T>This method begins a chain of binding builder DSL calls.protected final <T> voidbindInstanceInjector(Key<T> key) protected final <T> voidbindInstanceInjector(Class<T> key) protected final <T> voidbindInstanceProvider(Key<T> key) protected final <T> voidbindInstanceProvider(Class<T> key) protected final <S,T extends S>
voidbindIntoSet(Key<S> setOf, Binding<T> binding) This is a helper method that provides a functionality similar toProvidesIntoSet.protected final <S,T extends S>
voidbindIntoSet(Key<S> setOf, Key<T> item) This is a helper method that provides a functionality similar toProvidesIntoSet.protected final <S,T extends S>
voidbindIntoSet(Key<S> setOf, T element) This is a helper method that provides a functionality similar toProvidesIntoSet.protected final <T> voidbindOptionalDependency(Key<T> key) protected final <T> voidbindOptionalDependency(Class<T> key) combineWith(Module another) protected voidThis method is meant to be overridden to call all thebind(...)methods.protected final <T> voidgenerate(KeyPattern<T> pattern, BindingGenerator<T> bindingGenerator) Adds ageneratorfor a given class to this module.protected final <T> voidgenerate(Class<T> pattern, BindingGenerator<T> bindingGenerator) final Map<KeyPattern<?>,Set<BindingGenerator<?>>> final Map<KeyPattern<?>,Set<BindingTransformer<?>>> final Map<Key<?>,Multibinder<?>> protected final voidAdds all bindings, transformers, generators and multibinders from given modules to this one.protected final <T> voidmultibind(Key<T> key, Multibinder<T> multibinder) Adds amultibinderfor a given key to this module.protected final <K,V> void multibindToMap(Class<K> keyType, Class<V> valueType) protected final <K,V> void multibindToMap(Class<K> keyType, Class<V> valueType, Object qualifier) protected final <V> voidmultibindToSet(Key<V> key) protected final <V> voidmultibindToSet(Class<V> type) protected final <V> voidmultibindToSet(Class<V> type, Object qualifier) overrideWith(Module another) protected final voidprotected final voidtoString()protected final <T> voidtransform(KeyPattern<T> pattern, BindingTransformer<T> bindingTransformer) Adds atransformerwith a given type to this module.protected final <T> voidtransform(Class<T> pattern, BindingTransformer<T> bindingTransformer) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.activej.inject.module.Module
getExports, getImports
-
Constructor Details
-
AbstractModule
protected AbstractModule()
-
-
Method Details
-
configure
protected void configure()This method is meant to be overridden to call all thebind(...)methods. -
bind
This method begins a chain of binding builder DSL calls- See Also:
-
bind
This method begins a chain of binding builder DSL calls.- See Also:
-
bind
This method begins a chain of binding builder DSL calls.- See Also:
-
bindInstanceProvider
-
bindInstanceProvider
-
bindInstanceInjector
-
bindInstanceInjector
-
bindOptionalDependency
-
bindOptionalDependency
-
install
Adds all bindings, transformers, generators and multibinders from given modules to this one.This works just as if you'd define all of those directly in this module.
-
generate
Adds ageneratorfor a given class to this module. -
generate
-
transform
Adds atransformerwith a given type to this module. -
transform
-
multibind
Adds amultibinderfor a given key to this module. -
multibindToSet
-
multibindToSet
-
multibindToSet
-
multibindToMap
-
multibindToMap
-
bindIntoSet
This is a helper method that provides a functionality similar toProvidesIntoSet. It binds given binding as a singleton set to a set key made from given key and alsomultibindseach of such sets together.- See Also:
-
bindIntoSet
This is a helper method that provides a functionality similar toProvidesIntoSet. It binds given binding as a singleton set to a set key made from given key and alsomultibindseach of such sets together.- See Also:
-
bindIntoSet
This is a helper method that provides a functionality similar toProvidesIntoSet. It binds given binding as a singleton set to a set key made from given key and alsomultibindseach of such sets together.- See Also:
-
scan
-
scan
-
getBindings
- Specified by:
getBindingsin interfaceModule
-
getBindingTransformers
- Specified by:
getBindingTransformersin interfaceModule
-
getBindingGenerators
- Specified by:
getBindingGeneratorsin interfaceModule
-
getMultibinders
- Specified by:
getMultibindersin interfaceModule
-
combineWith
- Specified by:
combineWithin interfaceModule
-
overrideWith
- Specified by:
overrideWithin interfaceModule
-
transformWith
- Specified by:
transformWithin interfaceModule
-
toString
-