IdentifierResolver

interface IdentifierResolver<T : Any>

A resolver is an object that resolves an identifier into an actual component.

The implementation dictates how such a component is retrieved, created, etc. Resolvers have access to all components available in the environment, and can use any component they require to resolve the identifier. Resolvers are an intermediary step between the user (or some component) asking for a component, and the retrieval of that component in the environment.

The most commonly used implementation of this is SimpleIdentifierResolver, that simply retrieves the corresponding component in the environment. For an examples of a more advanced resolver, see AliasIdentifierResolver

Inheritors

Properties

Link copied to clipboard
abstract val requirements: List<Identifier<*>>

The requirements for this resolver, i.e. the identifiers that this resolver needs from the components argument of resolve. This information is used for dependency analysis to properly "link" components that are resolved against during resolution, such as with aliases.

Functions

Link copied to clipboard
abstract fun resolve(requester: Any?, components: EnvironmentComponents): T

Resolve using the given components. The components may be used in case the resolver requires more complicated use cases.