|
|||||||||||||||||||
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 | |||||||||||||||
SingletonConverterFactory.java | 0% | 0% | 0% | 0% |
|
1 |
/*
|
|
2 |
* Copyright (C) The Spice Group. All rights reserved.
|
|
3 |
*
|
|
4 |
* This software is published under the terms of the Spice
|
|
5 |
* Software License version 1.1, a copy of which has been included
|
|
6 |
* with this distribution in the LICENSE.txt file.
|
|
7 |
*/
|
|
8 |
package org.codehaus.spice.converter.lib;
|
|
9 |
|
|
10 |
import org.codehaus.spice.converter.ConverterFactory;
|
|
11 |
import org.codehaus.spice.converter.Converter;
|
|
12 |
|
|
13 |
/**
|
|
14 |
* A converter factory that just returns value supplied in ctor.
|
|
15 |
*
|
|
16 |
* @author Peter Donald
|
|
17 |
* @version $Revision: 1.1 $ $Date: 2003/12/02 08:37:56 $
|
|
18 |
*/
|
|
19 |
public class SingletonConverterFactory |
|
20 |
implements ConverterFactory
|
|
21 |
{ |
|
22 |
/**
|
|
23 |
* The converter managed by factory.
|
|
24 |
*/
|
|
25 |
private Converter m_converter;
|
|
26 |
|
|
27 |
/**
|
|
28 |
* Create factory with specified converter as singleton returned.
|
|
29 |
*
|
|
30 |
* @param converter the converter
|
|
31 |
*/
|
|
32 | 0 |
public SingletonConverterFactory( final Converter converter )
|
33 |
{ |
|
34 | 0 |
if( null == converter ) |
35 |
{ |
|
36 | 0 |
throw new NullPointerException( "converter" ); |
37 |
} |
|
38 | 0 |
m_converter = converter; |
39 |
} |
|
40 |
|
|
41 |
/**
|
|
42 |
* Return the singleton converter.
|
|
43 |
*
|
|
44 |
* @return the singleton converter.
|
|
45 |
*/
|
|
46 | 0 |
public Converter createConverter()
|
47 |
{ |
|
48 | 0 |
return m_converter;
|
49 |
} |
|
50 |
} |
|
51 |
|
|