1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.dictionary.service.impl.old; |
17 |
|
|
18 |
|
import java.util.ArrayList; |
19 |
|
import java.util.HashMap; |
20 |
|
import java.util.List; |
21 |
|
import java.util.Map; |
22 |
|
|
23 |
|
import javax.jws.WebService; |
24 |
|
|
25 |
|
import org.kuali.student.common.dictionary.old.dto.ObjectStructure; |
26 |
|
import org.kuali.student.common.dictionary.service.old.DictionaryService; |
27 |
|
import org.springframework.context.ApplicationContext; |
28 |
|
import org.springframework.context.ConfigurableApplicationContext; |
29 |
|
import org.springframework.context.support.ClassPathXmlApplicationContext; |
30 |
|
import org.springframework.util.StringUtils; |
31 |
|
|
32 |
|
@WebService(endpointInterface = "org.kuali.student.core.dictionary.service.DictionaryService", serviceName = "DictionaryService", portName = "DictionaryService", targetNamespace = "http://student.kuali.org/wsdl/dictionary") |
33 |
|
@Deprecated |
|
|
| 52.8% |
Uncovered Elements: 17 (36) |
Complexity: 11 |
Complexity Density: 0.5 |
|
34 |
|
public class DictionaryServiceSpringImpl implements DictionaryService { |
35 |
|
|
36 |
|
private String[] dictionaryContext; |
37 |
|
private Map<String, ObjectStructure> objectStructures; |
38 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
4
|
public DictionaryServiceSpringImpl() {... |
40 |
4
|
super(); |
41 |
|
} |
42 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (4) |
Complexity: 1 |
Complexity Density: 0.25 |
|
43 |
4
|
public DictionaryServiceSpringImpl(String dictionaryContext) {... |
44 |
4
|
super(); |
45 |
4
|
String[] locations = StringUtils.tokenizeToStringArray(dictionaryContext, ConfigurableApplicationContext.CONFIG_LOCATION_DELIMITERS); |
46 |
4
|
this.dictionaryContext = locations; |
47 |
4
|
init(); |
48 |
|
} |
49 |
|
|
|
|
| 0% |
Uncovered Elements: 3 (3) |
Complexity: 1 |
Complexity Density: 0.33 |
|
50 |
0
|
public DictionaryServiceSpringImpl(String[] dictionaryContext) {... |
51 |
0
|
super(); |
52 |
0
|
this.dictionaryContext = dictionaryContext; |
53 |
0
|
init(); |
54 |
|
} |
55 |
|
|
|
|
| 43.8% |
Uncovered Elements: 9 (16) |
Complexity: 4 |
Complexity Density: 0.4 |
|
56 |
4
|
@SuppressWarnings("unchecked")... |
57 |
|
public void init() { |
58 |
4
|
ApplicationContext ac = new ClassPathXmlApplicationContext(dictionaryContext); |
59 |
|
|
60 |
4
|
Map<String, ObjectStructure> beansOfType = (Map<String, ObjectStructure>) ac.getBeansOfType(ObjectStructure.class); |
61 |
4
|
objectStructures = new HashMap<String, ObjectStructure>(); |
62 |
4
|
for (ObjectStructure objStr : beansOfType.values()){ |
63 |
|
|
64 |
195
|
if(objStr.getId()!=null){ |
65 |
0
|
if(objStr.getId().startsWith("object.")){ |
66 |
0
|
if(!objStr.getId().startsWith("object.field.")){ |
67 |
0
|
objectStructures.put(objStr.getKey(), objStr); |
68 |
|
} |
69 |
|
}else{ |
70 |
0
|
objectStructures.put(objStr.getKey(), objStr); |
71 |
|
} |
72 |
|
}else{ |
73 |
195
|
objectStructures.put(objStr.getKey(), objStr); |
74 |
|
} |
75 |
|
} |
76 |
|
} |
77 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
78 |
2
|
@Override... |
79 |
|
public ObjectStructure getObjectStructure(String objectTypeKey) { |
80 |
2
|
return objectStructures.get(objectTypeKey); |
81 |
|
} |
82 |
|
|
|
|
| 100% |
Uncovered Elements: 0 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
83 |
1
|
@Override... |
84 |
|
public List<String> getObjectTypes() { |
85 |
1
|
return new ArrayList<String>(objectStructures.keySet()); |
86 |
|
} |
87 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
88 |
0
|
public String[] getDictionaryContext() {... |
89 |
0
|
return dictionaryContext; |
90 |
|
} |
91 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
92 |
0
|
public void setDictionaryContext(String[] dictionaryContext) {... |
93 |
0
|
this.dictionaryContext = dictionaryContext; |
94 |
|
} |
95 |
|
|
96 |
|
} |