Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
ConfigInitializer |
|
| 2.0;2 |
1 | /** | |
2 | * Copyright 2005-2011 The Kuali Foundation | |
3 | * | |
4 | * Licensed under the Educational Community License, Version 2.0 (the "License"); | |
5 | * you may not use this file except in compliance with the License. | |
6 | * You may obtain a copy of the License at | |
7 | * | |
8 | * http://www.opensource.org/licenses/ecl2.php | |
9 | * | |
10 | * Unless required by applicable law or agreed to in writing, software | |
11 | * distributed under the License is distributed on an "AS IS" BASIS, | |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
13 | * See the License for the specific language governing permissions and | |
14 | * limitations under the License. | |
15 | */ | |
16 | package org.kuali.rice.core.impl.config.property; | |
17 | ||
18 | import org.kuali.rice.core.api.config.property.ConfigContext; | |
19 | ||
20 | /** | |
21 | * This initializes a config object into the ConfigContext | |
22 | * as a root config or merges a config object into an already initialized root config | |
23 | * | |
24 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
25 | * | |
26 | */ | |
27 | public class ConfigInitializer { | |
28 | ||
29 | 0 | private ConfigInitializer() { |
30 | 0 | throw new UnsupportedOperationException("do not call"); |
31 | } | |
32 | ||
33 | /** | |
34 | * inits the root config or merges this config with the root config. | |
35 | * | |
36 | * <p> | |
37 | * This logic used to happen in the RiceConfigurer but was moved to facilitate the modularity work. | |
38 | * </p> | |
39 | */ | |
40 | public static void initialize(org.kuali.rice.core.api.config.property.Config config) { | |
41 | 0 | final org.kuali.rice.core.api.config.property.Config rootConfig = ConfigContext.getCurrentContextConfig(); |
42 | 0 | if (rootConfig == null) { |
43 | 0 | ConfigContext.init(config); |
44 | } else { | |
45 | 0 | rootConfig.putConfig(config); |
46 | } | |
47 | 0 | } |
48 | } |