Package io.activej.inject.impl
Class Preprocessor
java.lang.Object
io.activej.inject.impl.Preprocessor
This class contains a set of utils for working with binding graph trie.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic classstatic classstatic interface -
Method Summary
Modifier 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).collectCycles(Map<Key<?>, Binding<?>> bindings) This method performs a simple recursive DFS on given binding graph and returns all found cycles.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.
-
Method Details
-
reduce
public static Trie<Scope,Map<Key<?>, reduceBinding<?>>> (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.While doing so it also recursively tries to generate missing dependency bindings using given
generatorand apply givenBindingTransformerto all of them.- See Also:
-
check
A 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).It doesn't throw an error if and only if this graph is complete and being complete means that each binding dependencies should have a respective binding in the local or upper scope, and that there is no cyclic dependencies.
-
collectCycles
This method performs a simple recursive DFS on given binding graph and returns all found cycles.Unsatisfied dependencies are ignored.
-