Interface InjectableFactory


  • public interface InjectableFactory
    Factory for Injectables.
    • Method Detail

      • create

        <T> Injectable<T> create​(java.lang.reflect.Type ownerType,
                                 java.lang.reflect.Member member,
                                 java.lang.reflect.AnnotatedElement element,
                                 java.util.List<Binding> bindings,
                                 Constructable<T> constructable)
                          throws org.int4.dirk.api.definition.DefinitionException
        Creates Injectables given an owner Type, an optional Member an AnnotatedElement, a list of Bindings and a Constructable.

        The type of the Injectable is determined from the given member if not null and otherwise is the same as the given owner type.

        The scope and qualifiers of the Injectable are determined from the given annotated element.

        Type Parameters:
        T - the type of the instances produced
        Parameters:
        ownerType - a Type, cannot be null
        member - a Member of the ownerType, can be null
        element - an AnnotatedElement from which to get scope and qualifier annotations, cannot be null
        bindings - a list of Bindings, cannot be null or contain nulls, but can be empty
        constructable - a Constructable, cannot be null
        Returns:
        a Injectable, never null
        Throws:
        org.int4.dirk.api.definition.DefinitionException - when the owner type does not own the member; when the injectable's type cannot be determined or is void; when the annotated element has multiple scope annotations or is inject annotated