Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
XmlImpexRegistrationBean |
|
| 2.6;2.6 |
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.framework.impex.xml; | |
17 | ||
18 | import org.springframework.beans.factory.DisposableBean; | |
19 | import org.springframework.beans.factory.InitializingBean; | |
20 | ||
21 | import java.util.List; | |
22 | ||
23 | /** | |
24 | * This is a description of what this class does - ewestfal don't forget to fill this in. | |
25 | * | |
26 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
27 | * | |
28 | */ | |
29 | 0 | public class XmlImpexRegistrationBean implements InitializingBean, DisposableBean { |
30 | ||
31 | private List<XmlLoader> xmlLoadersToRegister; | |
32 | private List<XmlExporter> xmlExportersToRegister; | |
33 | ||
34 | private XmlImpexRegistry xmlImpexRegistry; | |
35 | ||
36 | @Override | |
37 | public void afterPropertiesSet() { | |
38 | 0 | if (xmlLoadersToRegister != null) { |
39 | 0 | for (XmlLoader xmlLoader : xmlLoadersToRegister) { |
40 | 0 | xmlImpexRegistry.registerLoader(xmlLoader); |
41 | } | |
42 | } | |
43 | 0 | if (xmlExportersToRegister != null) { |
44 | 0 | for (XmlExporter xmlExporter : xmlExportersToRegister) { |
45 | 0 | xmlImpexRegistry.registerExporter(xmlExporter); |
46 | } | |
47 | } | |
48 | 0 | } |
49 | ||
50 | @Override | |
51 | public void destroy() throws Exception { | |
52 | 0 | if (xmlLoadersToRegister != null) { |
53 | 0 | for (XmlLoader xmlLoader : xmlLoadersToRegister) { |
54 | 0 | xmlImpexRegistry.unregisterLoader(xmlLoader); |
55 | } | |
56 | } | |
57 | 0 | if (xmlExportersToRegister != null) { |
58 | 0 | for (XmlExporter xmlExporter : xmlExportersToRegister) { |
59 | 0 | xmlImpexRegistry.unregisterExporter(xmlExporter); |
60 | } | |
61 | } | |
62 | 0 | } |
63 | ||
64 | /** | |
65 | * @param xmlLoadersToRegister the xmlLoadersToRegister to set | |
66 | */ | |
67 | public void setXmlLoadersToRegister(List<XmlLoader> xmlLoadersToRegister) { | |
68 | 0 | this.xmlLoadersToRegister = xmlLoadersToRegister; |
69 | 0 | } |
70 | ||
71 | /** | |
72 | * @param xmlExportersToRegister the xmlExportersToRegister to set | |
73 | */ | |
74 | public void setXmlExportersToRegister(List<XmlExporter> xmlExportersToRegister) { | |
75 | 0 | this.xmlExportersToRegister = xmlExportersToRegister; |
76 | 0 | } |
77 | ||
78 | public void setXmlImpexRegistry(XmlImpexRegistry xmlImpexRegistry) { | |
79 | 0 | this.xmlImpexRegistry = xmlImpexRegistry; |
80 | 0 | } |
81 | } |