Uses of Class
io.activej.inject.Key
Packages that use Key
Package
Description
-
Uses of Key in io.activej.inject
Subclasses of Key in io.activej.injectMethods in io.activej.inject that return KeyModifier and TypeMethodDescription<U> Key<U>Key.getTypeParameter(int index) Returns a type parameter of the underlying type wrapped as a key with no qualifier.InstanceInjector.key()InstanceProvider.key()static <T> Key<T>static <T> Key<T>static <T> Key<T>static <T> Key<T>Returns a new key with same type but the qualifier replaced with a given oneMethods in io.activej.inject that return types with arguments of type KeyModifier and TypeMethodDescriptionInjector.ScopeLocalData.bindings()Returns the value of thebindingsrecord component.Map<Key<?>,CompiledBinding<?>> Injector.ScopeLocalData.compiledBindings()Returns the value of thecompiledBindingsrecord component.Injector.getBindings()This method returns bindings for current scopeInjector.getBindingsTrie()This method returns a trie of bindingsInjector.peekInstances()This method returns a copy of the injector cache - a map of all already created non-transient instances at the current scope.Injector.ScopeLocalData.slotMapping()Returns the value of theslotMappingrecord component.Methods in io.activej.inject with parameters of type KeyModifier and TypeMethodDescription@Nullable Binding<?>Injector.getBinding(Key<?> key) <T> TInjector.getInstance(Key<T> key) Returns an instance for given key.<T> TResourceLocator.getInstance(Key<T> key) <T> InstanceInjector<T>Injector.getInstanceInjector(Key<T> key) A shortcut forgetInstance(new Key<InstanceInjector<T>>(){})default <T> TResourceLocator.getInstanceOr(Key<T> key, T defaultValue) default <T> TResourceLocator.getInstanceOrCreate(Key<T> key, Supplier<T> defaultValueFn) <T> TInjector.getInstanceOrNull(Key<T> key) Same asInjector.getInstance(Key)except that it returnsnullinstead of throwing an exception.<T> TResourceLocator.getInstanceOrNull(Key<T> key) <T> InstanceProvider<T>Injector.getInstanceProvider(Key<T> key) A shortcut forgetInstance(new Key<InstanceProvider<T>>(){})<T> OptionalDependency<T>Injector.getOptionalDependency(Key<T> key) A shortcut forgetInstance(new Key<OptionalDependency<T>>(){})booleanInjector.hasBinding(Key<?> key) This method returns true if a binding was bound for given key.booleanInjector.hasInstance(Key<?> key) This method checks if an instance for this key was created by aInjector.getInstance(io.activej.inject.Key<T>)call before.boolean<T> TInjector.peekInstance(Key<T> key) This method returns an instance only if it already was created by aInjector.getInstance(io.activej.inject.Key<T>)call before, it does not trigger instance creation.<T> voidInjector.putInstance(Key<T> key, T instance) This method puts an instance into a cache slot of given key, meaning that already existing instance would be replaced or a binding would never be actually called.Method parameters in io.activej.inject with type arguments of type KeyModifier and TypeMethodDescriptionstatic InjectorInjector.compile(@Nullable Injector parent, Scope[] scope, Trie<Scope, Map<Key<?>, Set<Binding<?>>>> bindingsMultimap, Multibinder<?> multibinder, BindingTransformer<?> transformer, BindingGenerator<?> generator) The most full-fledged compile method that allows you to create an Injector of any configuration.static InjectorThis constructor is a shortcut for threadsafecompilewith no instance overrides and no multibinders, transformers or generators.Constructor parameters in io.activej.inject with type arguments of type KeyModifierConstructorDescriptionScopeLocalData(Scope[] scope, Map<Key<?>, Binding<?>> bindings, Map<Key<?>, CompiledBinding<?>> compiledBindings, Map<Key<?>, Integer> slotMapping, int slots, CompiledBinding<?>[] eagerSingletons) Creates an instance of aScopeLocalDatarecord class. -
Uses of Key in io.activej.inject.binding
Methods in io.activej.inject.binding that return KeyMethods in io.activej.inject.binding that return types with arguments of type KeyMethods in io.activej.inject.binding with parameters of type KeyModifier and TypeMethodDescriptionBinding.addDependencies(Key<?>... extraDependencies) static DIExceptionDIException.cannotConstruct(Key<?> key, @Nullable Binding<?> binding) BindingGenerator.generate(BindingLocator bindings, Scope[] scope, Key<T> key) booleanBinding.hasDependency(Key<?> dependency) Binding.mapDependency(Key<K> dependency, Function<? super K, ? extends K> fn) static DIExceptionDIException.noCachedBinding(Key<?> key, Scope[] scope) Binding.onDependency(Key<K> dependency, Consumer<? super K> consumer) static <T1,R> Binding<R> Binding.to(TupleConstructor1<T1, R> constructor, Key<T1> dependency1) static <T1,T2, R> Binding<R> Binding.to(TupleConstructor2<T1, T2, R> constructor, Key<T1> dependency1, Key<T2> dependency2) static <T1,T2, T3, R>
Binding<R>Binding.to(TupleConstructor3<T1, T2, T3, R> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3) static <T1,T2, T3, T4, R>
Binding<R>Binding.to(TupleConstructor4<T1, T2, T3, T4, R> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4) static <T1,T2, T3, T4, T5, R>
Binding<R>Binding.to(TupleConstructor5<T1, T2, T3, T4, T5, R> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4, Key<T5> dependency5) static <T1,T2, T3, T4, T5, T6, R>
Binding<R>Binding.to(TupleConstructor6<T1, T2, T3, T4, T5, T6, R> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4, Key<T5> dependency5, Key<T6> dependency6) static <R> Binding<R>Binding.to(TupleConstructorN<R> constructor, Key<?>[] dependencies) static <T> Binding<T>BindingTransformer.transform(BindingLocator bindings, Scope[] scope, Key<T> key, Binding<T> binding) Method parameters in io.activej.inject.binding with type arguments of type KeyModifier and TypeMethodDescriptionBinding.addDependencies(Set<Key<?>> extraDependencies) static Multibinder<?>Multibinders.combinedMultibinder(Map<Key<?>, Multibinder<?>> multibinders) Combines all multibinders into one by their type and returns universal multibinder for any key from the map, falling back toMultibinders.errorOnDuplicate()when map contains no multibinder for a given key.<R> Binding<R>Binding.mapInstance(List<Key<?>> dependencies, BiFunction<Object[], ? super T, ? extends R> fn) static <T> Multibinder<T>Multibinders.ofReducer(BiFunction<Key<T>, Stream<T>, T> reducerFunction) Multibinder that returns a binding that applies given reducing function to a stream of instances provided by all conflicting bindings.Constructor parameters in io.activej.inject.binding with type arguments of type KeyModifierConstructorDescriptionprotectedprotectedBinding(Set<Key<?>> dependencies, BindingType type, @Nullable LocationInfo location) -
Uses of Key in io.activej.inject.impl
Methods in io.activej.inject.impl that return KeyModifier and TypeMethodDescriptionPreprocessor.InstanceInjectorImpl.key()Preprocessor.InstanceProviderImpl.key()Methods in io.activej.inject.impl that return types with arguments of type KeyModifier and TypeMethodDescriptionBindingInitializer.getDependencies()Preprocessor.reduce(Trie<Scope, Map<Key<?>, Set<Binding<?>>>> bindings, Multibinder<?> multibinder, BindingTransformer<?> transformer, BindingGenerator<?> generator) This method converts a trie of binding multimaps, that is provided from the modules, into a trie of binding maps on which theInjectorwould actually operate.Methods in io.activej.inject.impl with parameters of type KeyModifier and TypeMethodDescription<T> @Nullable Binding<T>Retrieves existing binding for given key or tries to recursively generate it from knowngenerators.<Q> CompiledBinding<Q>@Nullable StringPreprocessor.ErrorHint.getHintFor(Map.Entry<Key<?>, Binding<?>> keybind, Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) @Nullable StringPreprocessor.MissingKeyHint.getHintFor(Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) Method parameters in io.activej.inject.impl with type arguments of type KeyModifier and TypeMethodDescriptionstatic voidA method that checks binding graph trie completeness, meaning that no binding references a key that is not present at same or lower level of the trie, and that there is no cycles in each scope (cycles between scopes are not possible).static voidA method that checks binding graph trie completeness, meaning that no binding references a key that is not present at same or lower level of the trie, and that there is no cycles in each scope (cycles between scopes are not possible).Preprocessor.collectCycles(Map<Key<?>, Binding<?>> bindings) This method performs a simple recursive DFS on given binding graph and returns all found cycles.@Nullable StringPreprocessor.ErrorHint.getHintFor(Map.Entry<Key<?>, Binding<?>> keybind, Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) @Nullable StringPreprocessor.ErrorHint.getHintFor(Map.Entry<Key<?>, Binding<?>> keybind, Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) @Nullable StringPreprocessor.ErrorHint.getHintFor(Map.Entry<Key<?>, Binding<?>> keybind, Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) @Nullable StringPreprocessor.MissingKeyHint.getHintFor(Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) @Nullable StringPreprocessor.MissingKeyHint.getHintFor(Key<?> missing, Set<Key<?>> upperKnown, Trie<Scope, Map<Key<?>, Binding<?>>> bindings) Preprocessor.reduce(Trie<Scope, Map<Key<?>, Set<Binding<?>>>> bindings, Multibinder<?> multibinder, BindingTransformer<?> transformer, BindingGenerator<?> generator) This method converts a trie of binding multimaps, that is provided from the modules, into a trie of binding maps on which theInjectorwould actually operate.Constructors in io.activej.inject.impl with parameters of type KeyModifierConstructorDescriptionInstanceInjectorImpl(Key<T> key, CompiledBindingInitializer<T> compiledBindingInitializer, AtomicReferenceArray[] scopedInstances, int synchronizedScope) InstanceProviderImpl(Key<T> key, CompiledBinding<T> compiledBinding, AtomicReferenceArray[] scopedInstances, int synchronizedScope) Constructor parameters in io.activej.inject.impl with type arguments of type Key -
Uses of Key in io.activej.inject.module
Methods in io.activej.inject.module that return types with arguments of type KeyModifier and TypeMethodDescriptionAbstractModule.getBindings()Module.getBindings()SimpleModule.getBindings()Module.getExports()Module.getImports()final Map<Key<?>,Multibinder<?>> AbstractModule.getMultibinders()Map<Key<?>,Multibinder<?>> Module.getMultibinders()Map<Key<?>,Multibinder<?>> SimpleModule.getMultibinders()Methods in io.activej.inject.module with parameters of type KeyModifier and TypeMethodDescriptionprotected final <T> ModuleBuilder0<T>This method begins a chain of binding builder DSL calls<T> ModuleBuilder0<T>This method begins a chain of binding builder DSL calls.<U> ModuleBuilder0<U>protected final <T> voidAbstractModule.bindInstanceInjector(Key<T> key) default <T> ModuleBuilderModuleBuilder.bindInstanceInjector(Key<T> key) protected final <T> voidAbstractModule.bindInstanceProvider(Key<T> key) default <T> ModuleBuilderModuleBuilder.bindInstanceProvider(Key<T> key) protected final <S,T extends S>
voidAbstractModule.bindIntoSet(Key<S> setOf, Binding<T> binding) This is a helper method that provides a functionality similar toProvidesIntoSet.protected final <S,T extends S>
voidAbstractModule.bindIntoSet(Key<S> setOf, Key<T> item) This is a helper method that provides a functionality similar toProvidesIntoSet.protected final <S,T extends S>
voidAbstractModule.bindIntoSet(Key<S> setOf, T element) This is a helper method that provides a functionality similar toProvidesIntoSet.<S,T extends S>
ModuleBuilderModuleBuilder.bindIntoSet(Key<S> setOf, Binding<T> binding) This is a helper method that provides a functionality similar toProvidesIntoSet.default <S,T extends S>
ModuleBuilderModuleBuilder.bindIntoSet(Key<S> setOf, Key<T> item) A helper method that provides a functionality similar toProvidesIntoSet.<S,E extends S>
ModuleBuilderModuleBuilderImpl.bindIntoSet(Key<S> setOf, Binding<E> binding) protected final <T> voidAbstractModule.bindOptionalDependency(Key<T> key) default <T> ModuleBuilderModuleBuilder.bindOptionalDependency(Key<T> key) protected final <T> voidAbstractModule.multibind(Key<T> key, Multibinder<T> multibinder) Adds amultibinderfor a given key to this module.<T> ModuleBuilderModuleBuilder.multibind(Key<T> key, Multibinder<T> multibinder) Adds amultibinderfor a given key to this module.<E> ModuleBuilderModuleBuilderImpl.multibind(Key<E> key, Multibinder<E> multibinder) protected final <V> voidAbstractModule.multibindToSet(Key<V> key) default <V> ModuleBuilderModuleBuilder.multibindToSet(Key<V> key) static Moduledefault <T1> ModuleBuilder1<T>ModuleBuilder0.to(TupleConstructor1<T1, ? extends T> constructor, Key<T1> dependency1) DSL shortcut for creating a binding andbinding itto a current key.default <T1,T2> ModuleBuilder1<T> ModuleBuilder0.to(TupleConstructor2<T1, T2, ? extends T> constructor, Key<T1> dependency1, Key<T2> dependency2) DSL shortcut for creating a binding andbinding itto a current key.default <T1,T2, T3> ModuleBuilder1<T> ModuleBuilder0.to(TupleConstructor3<T1, T2, T3, ? extends T> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3) DSL shortcut for creating a binding andbinding itto a current key.default <T1,T2, T3, T4>
ModuleBuilder1<T>ModuleBuilder0.to(TupleConstructor4<T1, T2, T3, T4, ? extends T> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4) DSL shortcut for creating a binding andbinding itto a current key.default <T1,T2, T3, T4, T5>
ModuleBuilder1<T>ModuleBuilder0.to(TupleConstructor5<T1, T2, T3, T4, T5, ? extends T> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4, Key<T5> dependency5) DSL shortcut for creating a binding andbinding itto a current key.default <T1,T2, T3, T4, T5, T6>
ModuleBuilder1<T>ModuleBuilder0.to(TupleConstructor6<T1, T2, T3, T4, T5, T6, ? extends T> constructor, Key<T1> dependency1, Key<T2> dependency2, Key<T3> dependency3, Key<T4> dependency4, Key<T5> dependency5, Key<T6> dependency6) DSL shortcut for creating a binding andbinding itto a current key.default ModuleBuilder1<T>ModuleBuilder0.to(TupleConstructorN<? extends T> factory, Key<?>[] dependencies) DSL shortcut for creating a binding andbinding itto a current key.default ModuleBuilder1<T>DSL shortcut for creating a binding that just calls a binding at a given key andbinding itto a current key.Method parameters in io.activej.inject.module with type arguments of type KeyModifier and TypeMethodDescriptionstatic ModuleCreates amoduleout of given binding graph triestatic ModuleModule.of(Trie<Scope, Map<Key<?>, Set<Binding<?>>>> bindings, Map<KeyPattern<?>, Set<BindingTransformer<?>>> transformers, Map<KeyPattern<?>, Set<BindingGenerator<?>>> generators, Map<Key<?>, Multibinder<?>> multibinders) Creates amoduleout of given binding graph trie, transformers, generators and multibindersstatic ModuleModules.remap(Module module, BiFunction<Scope[], Key<?>, Key<?>> exportsMapping, BiFunction<Scope[], Key<?>, Key<?>> importsMapping) static ModuleModules.remap(Module module, BiFunction<Scope[], Key<?>, Key<?>> exportsMapping, BiFunction<Scope[], Key<?>, Key<?>> importsMapping) static ModuleModules.remap(Module module, UnaryOperator<Key<?>> remapping) static Modulestatic Modulestatic ModuleModules.restrict(Module module, BiPredicate<Scope[], Key<?>> exportsPredicate) static Modulestatic ModuleConstructor parameters in io.activej.inject.module with type arguments of type KeyModifierConstructorDescriptionSimpleModule(Trie<Scope, Map<Key<?>, Set<Binding<?>>>> bindings, Map<KeyPattern<?>, Set<BindingTransformer<?>>> transformers, Map<KeyPattern<?>, Set<BindingGenerator<?>>> generators, Map<Key<?>, Multibinder<?>> multibinders) -
Uses of Key in io.activej.inject.util
Methods in io.activej.inject.util that return KeyModifier and TypeMethodDescriptionKey<?>ScopedKey.getKey()static <T> Key<T>ReflectionUtils.keyOf(@Nullable Type container, Type type, AnnotatedElement annotatedElement) static Key<?>[]ReflectionUtils.toDependencies(@Nullable Type container, Executable executable) Methods in io.activej.inject.util that return types with arguments of type KeyMethods in io.activej.inject.util with parameters of type KeyModifier and TypeMethodDescriptionstatic <T> Binding<T>ReflectionUtils.bindingFromConstructor(Key<T> key, Constructor<T> constructor) static Stringstatic <T> BindingInitializer<T>ReflectionUtils.fieldInjector(Key<T> container, Field field) ReflectionUtils.TemplatedProviderGenerator.generate(BindingLocator bindings, Scope[] scope, Key<Object> key) static <T> @Nullable Binding<T>ReflectionUtils.generateConstructorBinding(Key<T> key) static <T> @Nullable Binding<T>ReflectionUtils.generateImplicitBinding(Key<T> key) static <T> BindingInitializer<T>ReflectionUtils.generateInjectingInitializer(Key<T> container) static intUtils.getKeyDisplayCenter(Key<?> key) static <T> BindingInitializer<T>ReflectionUtils.methodInjector(Key<T> container, Method method) static ScopedKeystatic ScopedKeystatic ScopedKeyMethod parameters in io.activej.inject.util with type arguments of type KeyModifier and TypeMethodDescriptionstatic StringMakes a GraphViz graph representation of the binding graph.static voidUtils.mergeMultibinders(Map<Key<?>, Multibinder<?>> into, Map<Key<?>, Multibinder<?>> from) static voidA shortcut for printing the result ofUtils.makeGraphVizGraph(io.activej.inject.util.Trie<io.activej.inject.Scope, java.util.Map<io.activej.inject.Key<?>, io.activej.inject.binding.Binding<?>>>)into the standard output.