|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
ImplementationHidingComponentAdapterFactory.java | - | 100% | 100% | 100% |
|
1 |
/*****************************************************************************
|
|
2 |
* Copyright (c) PicoContainer Organization. All rights reserved. *
|
|
3 |
* ------------------------------------------------------------------------- *
|
|
4 |
* The software in this package is published under the terms of the BSD *
|
|
5 |
* style license a copy of which has been included with this distribution in *
|
|
6 |
* the LICENSE.txt file. *
|
|
7 |
* *
|
|
8 |
* Idea by Rachel Davies, Original code by Aslak Hellesoy and Paul Hammant *
|
|
9 |
*****************************************************************************/
|
|
10 |
|
|
11 |
package org.picocontainer.defaults;
|
|
12 |
|
|
13 |
import org.picocontainer.ComponentAdapter;
|
|
14 |
import org.picocontainer.Parameter;
|
|
15 |
import org.picocontainer.PicoIntrospectionException;
|
|
16 |
|
|
17 |
/**
|
|
18 |
* Hides implementation.
|
|
19 |
*
|
|
20 |
* @deprecated Use {@link org.nanocontainer.proxytoys.HotSwappingComponentAdapterFactory} instead.
|
|
21 |
* @author Paul Hammant
|
|
22 |
* @author Aslak Hellesøy
|
|
23 |
* @version $Revision: 1.6 $
|
|
24 |
*/
|
|
25 |
public class ImplementationHidingComponentAdapterFactory extends DecoratingComponentAdapterFactory { |
|
26 |
private final boolean strict; |
|
27 |
|
|
28 | 1 |
public ImplementationHidingComponentAdapterFactory() {
|
29 | 1 |
this(new ConstructorInjectionComponentAdapterFactory(), true); |
30 |
} |
|
31 |
|
|
32 | 12 |
public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate) {
|
33 | 12 |
this(delegate, true); |
34 |
} |
|
35 |
|
|
36 | 15 |
public ImplementationHidingComponentAdapterFactory(ComponentAdapterFactory delegate, boolean strict) { |
37 | 15 |
super(delegate);
|
38 | 15 |
this.strict = strict;
|
39 |
} |
|
40 |
|
|
41 | 16 |
public ComponentAdapter createComponentAdapter(Object componentKey,
|
42 |
Class componentImplementation, |
|
43 |
Parameter[] parameters) |
|
44 |
throws PicoIntrospectionException, AssignabilityRegistrationException, NotConcreteRegistrationException {
|
|
45 | 16 |
return new ImplementationHidingComponentAdapter(super.createComponentAdapter(componentKey, componentImplementation, parameters), strict); |
46 |
} |
|
47 |
} |
|
48 |
|
|