Package io.activej.inject.module
Class ModuleBuilderImpl<T>
java.lang.Object
io.activej.inject.module.ModuleBuilderImpl<T>
- All Implemented Interfaces:
ModuleBuilder,ModuleBuilder0<T>,ModuleBuilder1<T>
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionas(BindingType type) <U> ModuleBuilder0<U>This method begins a chain of binding builder DSL calls.<S,E extends S>
ModuleBuilderbindIntoSet(Key<S> setOf, Binding<E> binding) This is a helper method that provides a functionality similar toProvidesIntoSet.build()<E> ModuleBuildergenerate(KeyPattern<E> pattern, BindingGenerator<E> bindingGenerator) Adds ageneratorfor a given class to this module.The binding being built by this builder will be added to the binding graph trie at a given scope pathThe binding being built by this builder will be added to the binding graph trie at a given scope pathin(Class<? extends Annotation> annotationClass, Class<?>... annotationClasses) The binding being built by this builder will be added to the binding graph trie at a given scope pathinstall(Collection<Module> modules) Adds all bindings, transformers, generators and multibinders from given modules to this one.<E> ModuleBuildermultibind(Key<E> key, Multibinder<E> multibinder) Adds amultibinderfor a given key to this module.Scans class hierarchy and then installs providers from each class as modules, so that exports do not interfere between classes.Sets a binding which would be bound to a given key and added to the binding graph trietoString()<E> ModuleBuildertransform(KeyPattern<E> pattern, BindingTransformer<E> bindingTransformer) Adds atransformerwith a given type to this module.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.activej.inject.module.ModuleBuilder
bind, bind, bindInstanceInjector, bindInstanceInjector, bindInstanceProvider, bindInstanceProvider, bindIntoSet, bindOptionalDependency, bindOptionalDependency, generate, install, multibindToMap, multibindToMap, multibindToSet, multibindToSet, multibindToSet, scan, scan, transformMethods inherited from interface io.activej.inject.module.ModuleBuilder0
to, to, to, to, to, to, to, to, to, to, to, to, to, to, to, to, to, to, toInstanceMethods inherited from interface io.activej.inject.module.ModuleBuilder1
asEager, asTransient
-
Method Details
-
bind
Description copied from interface:ModuleBuilderThis method begins a chain of binding builder DSL calls.You can use generics in it, only those that are defined at the module class. And you need to subclass the module at the usage point to 'bake' those generics into subclass bytecode so that they could be fetched by this bind call.
- Specified by:
bindin interfaceModuleBuilder
-
in
Description copied from interface:ModuleBuilder0The binding being built by this builder will be added to the binding graph trie at a given scope path- Specified by:
inin interfaceModuleBuilder0<T>
-
in
Description copied from interface:ModuleBuilder0The binding being built by this builder will be added to the binding graph trie at a given scope path- Specified by:
inin interfaceModuleBuilder0<T>- See Also:
-
in
public ModuleBuilder1<T> in(Class<? extends Annotation> annotationClass, Class<?>... annotationClasses) Description copied from interface:ModuleBuilder0The binding being built by this builder will be added to the binding graph trie at a given scope path- Specified by:
inin interfaceModuleBuilder0<T>- See Also:
-
to
Description copied from interface:ModuleBuilder0Sets a binding which would be bound to a given key and added to the binding graph trie- Specified by:
toin interfaceModuleBuilder0<T>
-
as
- Specified by:
asin interfaceModuleBuilder1<T>
-
scan
Description copied from interface:ModuleBuilderScans class hierarchy and then installs providers from each class as modules, so that exports do not interfere between classes. Class parameter is used to specify from which class in the hierarchy to start.- Specified by:
scanin interfaceModuleBuilder
-
install
Description copied from interface:ModuleBuilderAdds 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.
- Specified by:
installin interfaceModuleBuilder
-
bindIntoSet
Description copied from interface:ModuleBuilderThis 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.- Specified by:
bindIntoSetin interfaceModuleBuilder
-
generate
Description copied from interface:ModuleBuilderAdds ageneratorfor a given class to this module.- Specified by:
generatein interfaceModuleBuilder
-
transform
Description copied from interface:ModuleBuilderAdds atransformerwith a given type to this module.- Specified by:
transformin interfaceModuleBuilder
-
multibind
Description copied from interface:ModuleBuilderAdds amultibinderfor a given key to this module.- Specified by:
multibindin interfaceModuleBuilder
-
build
- Specified by:
buildin interfaceModuleBuilder
-
toString
-