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