1 package org.picocontainer.alternatives; 2 3 import org.picocontainer.ComponentAdapter; 4 import org.picocontainer.Parameter; 5 import org.picocontainer.PicoIntrospectionException; 6 import org.picocontainer.defaults.AssignabilityRegistrationException; 7 import org.picocontainer.defaults.ComponentAdapterFactory; 8 import org.picocontainer.defaults.DecoratingComponentAdapterFactory; 9 import org.picocontainer.defaults.NotConcreteRegistrationException; 10 11 15 public class ImplementationHidingComponentAdapterFactory extends DecoratingComponentAdapterFactory { 16 private final boolean strict; 17 18 21 public ImplementationHidingComponentAdapterFactory() { 22 this(null); 23 } 24 25 public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate, boolean strict) { 26 super(delegate); 27 this.strict = strict; 28 } 29 30 public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate) { 31 this(delegate, true); 32 } 33 34 public ComponentAdapter createComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException { 35 return new ImplementationHidingComponentAdapter(super.createComponentAdapter(componentKey, componentImplementation, parameters), strict); 36 } 37 } 38 | Popular Tags |