1 |
|
|
2 |
|
|
3 |
|
|
4 |
|
|
5 |
|
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
|
|
10 |
|
|
11 |
|
|
12 |
|
|
13 |
|
|
14 |
|
|
15 |
|
|
16 |
|
package org.kuali.student.common.exceptions; |
17 |
|
|
18 |
|
import java.io.PrintStream; |
19 |
|
import java.io.PrintWriter; |
20 |
|
import java.util.List; |
21 |
|
|
22 |
|
import javax.xml.ws.WebFault; |
23 |
|
|
24 |
|
import org.apache.log4j.Logger; |
25 |
|
import org.kuali.student.common.dto.ValidationResultInfo; |
26 |
|
|
27 |
|
@WebFault(faultBean="org.kuali.student.common.exceptions.jaxws.DataValidationErrorExceptionBean") |
|
|
| 0% |
Uncovered Elements: 34 (34) |
Complexity: 12 |
Complexity Density: 0.57 |
|
28 |
|
public class DataValidationErrorException extends Exception { |
29 |
|
|
30 |
|
final Logger LOG = Logger.getLogger(DataValidationErrorException.class); |
31 |
|
|
32 |
|
private static final long serialVersionUID = 1L; |
33 |
|
|
34 |
|
private List<ValidationResultInfo> validationResults; |
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
39 |
0
|
public DataValidationErrorException() {... |
40 |
0
|
super(); |
41 |
|
} |
42 |
|
|
43 |
|
|
44 |
|
@param |
45 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
46 |
0
|
public DataValidationErrorException(String message, List<ValidationResultInfo> validationResults) {... |
47 |
0
|
this(message, validationResults, null); |
48 |
|
} |
49 |
|
|
50 |
|
|
51 |
|
@param |
52 |
|
@param |
53 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
54 |
0
|
public DataValidationErrorException(String message, List<ValidationResultInfo> validationResults, Throwable cause) {... |
55 |
0
|
super(message, cause); |
56 |
0
|
this.validationResults = validationResults; |
57 |
|
} |
58 |
|
|
59 |
|
|
60 |
|
@param |
61 |
|
@param |
62 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
63 |
0
|
public DataValidationErrorException(String message, Throwable cause) {... |
64 |
0
|
super(message, cause); |
65 |
|
} |
66 |
|
|
67 |
|
|
68 |
|
@param |
69 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
70 |
0
|
public DataValidationErrorException(String message) {... |
71 |
0
|
super(message); |
72 |
|
} |
73 |
|
|
74 |
|
|
75 |
|
@param |
76 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
77 |
0
|
public DataValidationErrorException(Throwable cause) {... |
78 |
0
|
super(cause); |
79 |
|
} |
80 |
|
|
81 |
|
|
82 |
|
|
83 |
|
@return |
84 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
85 |
0
|
public List<ValidationResultInfo> getValidationResults() {... |
86 |
0
|
return validationResults; |
87 |
|
} |
88 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
89 |
0
|
@Override... |
90 |
|
public void printStackTrace(PrintStream s) { |
91 |
0
|
super.printStackTrace(s); |
92 |
0
|
logValidationResults(); |
93 |
|
} |
94 |
|
|
|
|
| 0% |
Uncovered Elements: 2 (2) |
Complexity: 1 |
Complexity Density: 0.5 |
|
95 |
0
|
@Override... |
96 |
|
public void printStackTrace(PrintWriter s) { |
97 |
0
|
super.printStackTrace(s); |
98 |
0
|
logValidationResults(); |
99 |
|
} |
100 |
|
|
|
|
| 0% |
Uncovered Elements: 10 (10) |
Complexity: 2 |
Complexity Density: 0.25 |
|
101 |
0
|
@Override... |
102 |
|
public String toString() { |
103 |
0
|
StringBuilder sb = new StringBuilder(); |
104 |
0
|
sb.append(super.getMessage()).append("\n"); |
105 |
0
|
if (validationResults != null){ |
106 |
0
|
sb.append("Validation Results: \n"); |
107 |
0
|
for (ValidationResultInfo info:validationResults){ |
108 |
0
|
sb.append(info).append("\n"); |
109 |
|
} |
110 |
|
} else { |
111 |
0
|
sb.append("Validation Results: None set."); |
112 |
|
} |
113 |
0
|
return sb.toString(); |
114 |
|
} |
115 |
|
|
|
|
| 0% |
Uncovered Elements: 1 (1) |
Complexity: 1 |
Complexity Density: 1 |
|
116 |
0
|
private void logValidationResults(){... |
117 |
0
|
LOG.debug(toString()); } |
118 |
|
|
119 |
|
|
120 |
|
|
121 |
|
} |