Interface DiscovererFactory


  • public interface DiscovererFactory
    Gathers fully expanded sets of Injectables based on the given inputs.

    A distinction is made between derived and discovered injectables. Derived injectables are detected by examining a given Type, for example through annotations. Discovered injectables are injectables created for unresolved bindings of an input or derived injectable.

    Derivation always takes precedence over discovery.

    Implementations of this interface can scan given types (ie. for annotations) to derive further injectables that can be supplied.

    • Method Detail

      • create

        Discoverer create​(Resolver<Injectable<?>> resolver,
                          Injectable<?> injectable)
        Given an Injectable, returns a Discoverer which will produce the given injectable and all injectables that could be derived or discovered using the injectable as starting point.
        Parameters:
        resolver - a Resolver, cannot be null
        injectable - a list of Types, cannot be null or contain nulls
        Returns:
        a Discoverer, never null
      • create

        Discoverer create​(Resolver<Injectable<?>> resolver,
                          java.util.Collection<java.lang.reflect.Type> types)
        Given a list of Types, returns a Discoverer which will produce injectables for each of the types given and all injectables that could be derived or discovered using the given types as starting point.
        Parameters:
        resolver - a Resolver, cannot be null
        types - a collection of Types, cannot be null or contain nulls
        Returns:
        a Discoverer, never null