Interface ComponentFactory

    • Method Detail

      • containsComponent

        boolean containsComponent​(String type)
        Checks whether the specified components class or alias is already registered.
        Parameters:
        type - the fully qualified class name or an alias of the component.
        Returns:
        true if a provider exist, false otherwise.
      • containsComponent

        <T> boolean containsComponent​(String type,
                                      Qualifier<T> qualifier)
        Checks whether a components is already registered for the specified type and scope.
        Parameters:
        type - the component type.
        qualifier - the options to qualified the component.
        Returns:
        true if a provider exist, false otherwise.
      • containsComponent

        <T> boolean containsComponent​(Class<T> type)
        Checks whether a components is already registered for the specified class.
        Parameters:
        type - the component type.
        Returns:
        true if a provider exist, false otherwise.
      • containsComponent

        <T> boolean containsComponent​(Class<T> type,
                                      Qualifier<T> qualifier)
        Checks whether a components is already registered for the specified type and scope.
        Parameters:
        type - the component type.
        qualifier - the options to qualified the component.
        Returns:
        true if a provider exist, false otherwise.
      • getComponent

        <T> T getComponent​(Class<T> type,
                           Conf conf)
        Gets an instance, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        conf - the configuration used if the component implement Configurable.
        Returns:
        the instance of type ComponentFactory.
        Throws:
        NoUniqueComponentException - if more than one component is registered for the given type.
        NoSuchComponentException - if no component is registered for the given type.
      • getComponent

        <T> T getComponent​(Class<T> type,
                           Conf conf,
                           Qualifier<T> qualifier)
        Gets an instance, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        conf - the configuration used if the component implement Configurable.
        qualifier - the options used to qualify the component.
        Returns:
        the instance of type ComponentFactory.
        Throws:
        NoUniqueComponentException - if more than one component is registered for the given type.
        NoSuchComponentException - if no component is registered for the given type.
      • getComponent

        <T> GettableComponent<T> getComponent​(Class<T> type,
                                              Qualifier<T> qualifier)
        Gets an instance, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        qualifier - the options used to qualified the component.
        Returns:
        the instance of type ComponentFactory.
        Throws:
        NoUniqueComponentException - if more than one component is registered for the given type.
        NoSuchComponentException - if no component is registered for the given type.
      • getComponent

        <T> T getComponent​(String type,
                           Conf conf)
        Gets an instance, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the fully qualified class name or an alias of the component.
        conf - the configuration used if the component implement Configurable.
        Returns:
        the instance of type ComponentFactory.
        Throws:
        NoUniqueComponentException - if more than one component is registered for the given type.
        NoSuchComponentException - if no component is registered for the given class or alias..
      • getComponent

        <T> T getComponent​(String type,
                           Conf conf,
                           Qualifier<T> qualifier)
        Gets an instance, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the fully qualified class name or an alias of the component.
        conf - the configuration used if the component implement Configurable.
        qualifier - the options used to qualify the component.
        Returns:
        the instance of type ComponentFactory.
        Throws:
        NoUniqueComponentException - if more than one component is registered for the given type.
        NoSuchComponentException - if no component is registered for the given class or alias..
      • getAllComponents

        <T> Collection<T> getAllComponents​(String type,
                                           Conf conf)
        Gets all instances, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the fully qualified class name or an alias of the component.
        conf - the configuration used if the component implement Configurable.
        Returns:
        all instances of type ComponentFactory.
      • getAllComponents

        <T> Collection<T> getAllComponents​(String type,
                                           Conf conf,
                                           Qualifier<T> qualifier)
        Gets all instances, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the fully qualified class name or an alias of the component.
        conf - the configuration used if the component implement Configurable.
        qualifier - the options used to qualify the component.
        Returns:
        all instances of type ComponentFactory.
      • getAllComponents

        <T> Collection<T> getAllComponents​(Class<T> type,
                                           Conf conf)
        Gets all instances, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        conf - the configuration used if the component implement Configurable.
        Returns:
        all instances of type ComponentFactory.
      • getAllComponents

        <T> Collection<T> getAllComponents​(Class<T> type,
                                           Conf conf,
                                           Qualifier<T> qualifier)
        Gets all instances, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        conf - the configuration used if the component implement Configurable.
        qualifier - the options used to qualify the component.
        Returns:
        all instances of type ComponentFactory.
      • getAllComponents

        <T> Collection<GettableComponent<T>> getAllComponents​(Class<T> type,
                                                              Qualifier<T> qualifier)
        Gets all instances, which may be shared or independent, for the specified type.
        Type Parameters:
        T - the component-type.
        Parameters:
        type - the component class.
        qualifier - the options used to qualify the component.
        Returns:
        all instances of type ComponentFactory.