/** * Gets parameter injectors. * * @param member to which the parameters belong * @param annotations on the parameters * @param parameterTypes parameter types * * @return injections */ <M extends AccessibleObject & Member> ParameterInjector<?>[] getParametersInjectors( M member, Annotation[][] annotations, Class[] parameterTypes, String defaultName ) throws MissingDependencyException { List<ParameterInjector<?>> parameterInjectors = new ArrayList<ParameterInjector<?>>(); Iterator<Annotation[]> annotationsIterator = Arrays.asList(annotations).iterator(); for ( Class<?> parameterType : parameterTypes ) { Inject annotation = findInject(annotationsIterator.next()); String name = annotation == null ? defaultName : annotation.value(); Key<?> key = Key.newInstance(parameterType, name); parameterInjectors.add(createParameterInjector(key, member)); } return toArray(parameterInjectors); }