001 /***************************************************************************** 002 * Copyright (C) PicoContainer Organization. All rights reserved. * 003 * ------------------------------------------------------------------------- * 004 * The software in this package is published under the terms of the BSD * 005 * style license a copy of which has been included with this distribution in * 006 * the LICENSE.txt file. * 007 * * 008 *****************************************************************************/ 009 package org.picocontainer.injectors; 010 011 import org.picocontainer.Parameter; 012 import org.picocontainer.ComponentMonitor; 013 import org.picocontainer.LifecycleStrategy; 014 import org.picocontainer.annotations.Inject; 015 016 /** @author Paul Hammant */ 017 @SuppressWarnings("serial") 018 public class MultiInjector extends CompositeInjector { 019 020 public MultiInjector(Object componentKey, 021 Class componentImplementation, 022 Parameter[] parameters, 023 ComponentMonitor componentMonitor, String setterPrefix, boolean useNames) { 024 super(componentKey, componentImplementation, parameters, componentMonitor, useNames, 025 componentMonitor.newInjector(new ConstructorInjector(componentKey, componentImplementation, parameters, componentMonitor, useNames)), 026 componentMonitor.newInjector(new SetterInjector(componentKey, componentImplementation, parameters, componentMonitor, setterPrefix, useNames)), 027 componentMonitor.newInjector(new AnnotatedMethodInjector(componentKey, componentImplementation, parameters, componentMonitor, Inject.class, useNames)), 028 componentMonitor.newInjector(new AnnotatedFieldInjector(componentKey, componentImplementation, parameters, componentMonitor, Inject.class, useNames))); 029 030 } 031 032 public String getDescriptor() { 033 return "MultiInjector"; 034 } 035 }