KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > inversoft > verge > config > test > TestConfigFactory


1 /*
2  * Copyright (c) 2003, Inversoft
3  *
4  * This software is distribuable under the GNU Lesser General Public License.
5  * For more information visit gnu.org.
6  */

7 package com.inversoft.verge.config.test;
8
9
10 import com.inversoft.config.ConfigBuilder;
11 import com.inversoft.config.ConfigFactory;
12 import com.inversoft.config.ConfigRegistry;
13
14
15 /**
16  * <p>
17  * This class is a test implementation of the factory
18  * </p>
19  *
20  * @author Brian Pontarelli
21  * @since 2.0
22  * @version 2.0
23  */

24 public class TestConfigFactory implements ConfigFactory {
25
26     public static boolean createBuilder = false;
27     public static boolean createRegistry = false;
28     public static boolean nullRegistry = false;
29
30     /**
31      */

32     public ConfigBuilder createBuilder() {
33         if (createBuilder) {
34             return new TestConfigBuilder();
35         }
36
37         return TestConfigBuilder.INSTANCE;
38     }
39
40     /**
41      */

42     public ConfigRegistry createRegistry() {
43         if (createRegistry) {
44             return new TestConfigRegistry();
45         }
46
47         if (nullRegistry) {
48             return null;
49         }
50
51         return TestConfigRegistry.INSTANCE;
52     }
53
54 }
55
Popular Tags