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 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| public class ImplementationHidingComponentAdapterFactory extends DecoratingComponentAdapterFactory { |
16 |
| private final boolean strict; |
17 |
| |
18 |
| |
19 |
| |
20 |
| |
21 |
0
| public ImplementationHidingComponentAdapterFactory() {
|
22 |
0
| this(null);
|
23 |
| } |
24 |
| |
25 |
84
| public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate, boolean strict) {
|
26 |
84
| super(delegate);
|
27 |
84
| this.strict = strict;
|
28 |
| } |
29 |
| |
30 |
0
| public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate) {
|
31 |
0
| this(delegate, true);
|
32 |
| } |
33 |
| |
34 |
72
| public ComponentAdapter createComponentAdapter(Object componentKey, Class componentImplementation, Parameter[] parameters) throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
|
35 |
72
| return new ImplementationHidingComponentAdapter(super.createComponentAdapter(componentKey, componentImplementation, parameters), strict);
|
36 |
| } |
37 |
| } |