1 package org.nanocontainer.script; 2 3 import org.picocontainer.alternatives.AbstractDelegatingMutablePicoContainer; 4 import org.picocontainer.MutablePicoContainer; 5 import org.picocontainer.ComponentAdapter; 6 import org.picocontainer.PicoRegistrationException; 7 import org.picocontainer.Parameter; 8 9 import java.util.HashMap ; 10 import java.util.ArrayList ; 11 12 import junit.framework.Assert; 13 14 public class FooDecoratingPicoContainer extends AbstractDelegatingMutablePicoContainer { 15 public FooDecoratingPicoContainer(MutablePicoContainer delegate) { 16 super(delegate); 17 } 18 public MutablePicoContainer makeChildContainer() { 19 return null; 20 } 21 22 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoRegistrationException { 23 Assert.assertEquals(HashMap .class, componentImplementation); 24 return super.registerComponentImplementation(ArrayList .class, ArrayList .class, parameters); 25 } 26 public ComponentAdapter registerComponentImplementation(Object componentKey, Class componentImplementation) throws PicoRegistrationException { 27 Assert.assertEquals(HashMap .class, componentImplementation); 28 return super.registerComponentImplementation(ArrayList .class, ArrayList .class); 29 } 30 31 } 32 | Popular Tags |