Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
KNSModuleService |
|
| 3.6666666666666665;3.667 |
1 | /* | |
2 | * Copyright 2007-2009 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.kns.service.impl; | |
17 | ||
18 | import java.util.List; | |
19 | import java.util.Map; | |
20 | ||
21 | import org.kuali.rice.kns.bo.ExternalizableBusinessObject; | |
22 | import org.kuali.rice.kns.util.ExternalizableBusinessObjectUtils; | |
23 | ||
24 | /** | |
25 | * This is a description of what this class does - jjhanso don't forget to fill this in. | |
26 | * | |
27 | * @author Kuali Rice Team (rice.collab@kuali.org) | |
28 | * | |
29 | */ | |
30 | 0 | public class KNSModuleService extends ModuleServiceBase { |
31 | ||
32 | protected List<String> businessObjects; | |
33 | ||
34 | @Override | |
35 | public boolean isResponsibleFor(Class businessObjectClass) { | |
36 | 0 | if (businessObjects != null) { |
37 | 0 | if (businessObjects.contains(businessObjectClass.getName())) { |
38 | 0 | return true; |
39 | } | |
40 | } | |
41 | 0 | if (ExternalizableBusinessObject.class.isAssignableFrom(businessObjectClass)) { |
42 | 0 | Class externalizableBusinessObjectInterface = ExternalizableBusinessObjectUtils.determineExternalizableBusinessObjectSubInterface(businessObjectClass); |
43 | 0 | if (externalizableBusinessObjectInterface != null) { |
44 | 0 | Map<Class, Class> validEBOs = getModuleConfiguration().getExternalizableBusinessObjectImplementations(); |
45 | 0 | if (validEBOs != null) { |
46 | 0 | if (validEBOs.get(externalizableBusinessObjectInterface) != null) { |
47 | 0 | return true; |
48 | } | |
49 | } | |
50 | } | |
51 | } | |
52 | 0 | return false; |
53 | } | |
54 | ||
55 | public List<String> getBusinessObjects() { | |
56 | 0 | return this.businessObjects; |
57 | } | |
58 | ||
59 | public void setBusinessObjects(List<String> businessObjects) { | |
60 | 0 | this.businessObjects = businessObjects; |
61 | 0 | } |
62 | } |