Class IterativeInjector<T>

    • Field Detail

      • injectionMembers

        protected transient java.util.List<java.lang.reflect.AccessibleObject> injectionMembers
      • injectionTypes

        protected transient java.lang.reflect.Type[] injectionTypes
      • bindings

        protected transient java.lang.annotation.Annotation[] bindings
    • Constructor Detail

      • IterativeInjector

        public IterativeInjector​(java.lang.Object componentKey,
                                 java.lang.Class componentImplementation,
                                 Parameter[] parameters,
                                 ComponentMonitor monitor,
                                 boolean useNames)
                          throws AbstractInjector.NotConcreteRegistrationException
        Constructs a IterativeInjector
        Parameters:
        componentKey - the search key for this implementation
        componentImplementation - the concrete implementation
        parameters - the parameters to use for the initialization
        monitor - the component monitor used by this addAdapter
        useNames - use argument names when looking up dependencies
        Throws:
        AbstractInjector.NotConcreteRegistrationException - if the implementation is not a concrete class.
        java.lang.NullPointerException - if one of the parameters is null
    • Method Detail

      • getConstructor

        protected java.lang.reflect.Constructor getConstructor()
      • makeParameterNameImpl

        protected NameBinding makeParameterNameImpl​(java.lang.reflect.AccessibleObject member)
      • unsatisfiedDependencies

        protected abstract void unsatisfiedDependencies​(PicoContainer container,
                                                        java.util.Set<java.lang.reflect.Type> unsatisfiableDependencyTypes,
                                                        java.util.List<java.lang.reflect.AccessibleObject> unsatisfiableDependencyMembers)
      • getComponentInstance

        public T getComponentInstance​(PicoContainer container,
                                      java.lang.reflect.Type into)
                               throws PicoCompositionException
        Description copied from interface: ComponentAdapter
        Retrieve the component instance. This method will usually create a new instance each time it is called, but that is not required. For example, Cached will always return the same instance.
        Specified by:
        getComponentInstance in interface ComponentAdapter<T>
        Specified by:
        getComponentInstance in class AbstractInjector<T>
        Parameters:
        container - the PicoContainer, that is used to resolve any possible dependencies of the instance.
        into - the class that is about to be injected into. Use ComponentAdapter.NOTHING.class if this is not important to you.
        Returns:
        the component instance.
        Throws:
        PicoCompositionException - if the component has dependencies which could not be resolved, or instantiation of the component lead to an ambiguous situation within the container.
      • memberInvocationReturn

        protected abstract java.lang.Object memberInvocationReturn​(java.lang.Object lastReturn,
                                                                   java.lang.reflect.AccessibleObject member,
                                                                   java.lang.Object instance)
      • decorateComponentInstance

        public java.lang.Object decorateComponentInstance​(PicoContainer container,
                                                          java.lang.reflect.Type into,
                                                          T instance)
        Description copied from interface: Injector
        A preexiting component instance can be injected into after instantiation
        Specified by:
        decorateComponentInstance in interface Injector<T>
        Overrides:
        decorateComponentInstance in class AbstractInjector<T>
        Parameters:
        container - the container that can provide injectable dependencies
        instance - the instance to
        Returns:
      • injectIntoMember

        protected abstract java.lang.Object injectIntoMember​(java.lang.reflect.AccessibleObject member,
                                                             java.lang.Object componentInstance,
                                                             java.lang.Object toInject)
                                                      throws java.lang.IllegalAccessException,
                                                             java.lang.reflect.InvocationTargetException
        Throws:
        java.lang.IllegalAccessException
        java.lang.reflect.InvocationTargetException
      • initializeInjectionMembersAndTypeLists

        protected void initializeInjectionMembersAndTypeLists()
      • crudeMethodSignature

        public static java.lang.String crudeMethodSignature​(java.lang.reflect.Method method)
      • getName

        protected java.lang.String getName​(java.lang.reflect.Method method)
      • isInjectorMethod

        protected boolean isInjectorMethod​(java.lang.reflect.Method method)