Interface InstanceProvider<T,​E>

  • Type Parameters:
    T - the type handled
    E - the element type required

    public interface InstanceProvider<T,​E>
    Provides instances of type T created from elements of type E.
    • Method Detail

      • getInstance

        T getInstance​(Instance<E> instance)
        Creates an instance of type T using the given Instance. Returning null is allowed to indicate the absence of a value. Depending on the destination where the value is used this can mean null is injected (methods and constructors), that the value is not injected (fields) or that an UnsatisfiedResolutionException is thrown (direct instance resolver call).
        Parameters:
        instance - an Instance, cannot be null
        Returns:
        an instance of type T, can be null
        Throws:
        CreationException - when the instance could not be created
        AmbiguousResolutionException - when multiple instances matched but at most one was required
        UnsatisfiedResolutionException - when no instance matched but at least one was required
        ScopeNotActiveException - when the scope for the produced type is not active