io.datakernel.di.impl.BindingLocator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of datakernel-di Show documentation
Show all versions of datakernel-di Show documentation
DataKernel has an extremely lightweight DI with ground-breaking design principles.
It supports nested scopes, singletons, object factories, modules and plugins which
allow to transform graph of dependencies at startup time without any reflection.
The newest version!
package io.datakernel.di.impl;
import io.datakernel.di.core.Binding;
import io.datakernel.di.core.BindingGenerator;
import io.datakernel.di.core.Key;
import org.jetbrains.annotations.Nullable;
/**
* This function is passed to a {@link BindingGenerator generator} when trying to generate a binding.
*
* Generators can depend on other bindings that could not be present but can be generated.
* This function is used as a mean of recursion - when no requested binding is present it tries to generate it,
* and it is called from the generator itself.
*/
@FunctionalInterface
public interface BindingLocator {
/**
* Retrieves existing binding for given key or tries to recursively generate it from known {@link BindingGenerator generators}.
*/
@Nullable Binding get(Key key);
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy