1 |
| |
2 |
| |
3 |
| |
4 |
| package net.sourceforge.pmd; |
5 |
| |
6 |
| import java.io.PrintStream; |
7 |
| import java.io.PrintWriter; |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| public class PMDException extends Exception { |
19 |
| |
20 |
| private Exception reason; |
21 |
| private int severity; |
22 |
| |
23 |
0
| public PMDException(String message) {
|
24 |
0
| super(message);
|
25 |
| } |
26 |
| |
27 |
0
| public PMDException(String message, Exception reason) {
|
28 |
0
| super(message);
|
29 |
0
| this.reason = reason;
|
30 |
| } |
31 |
| |
32 |
0
| public void printStackTrace() {
|
33 |
0
| printStackTrace(System.err);
|
34 |
| } |
35 |
| |
36 |
0
| public void printStackTrace(PrintStream s) {
|
37 |
0
| super.printStackTrace(s);
|
38 |
0
| if (this.reason != null) {
|
39 |
0
| s.print("Caused by: ");
|
40 |
0
| this.reason.printStackTrace(s);
|
41 |
| } |
42 |
| } |
43 |
| |
44 |
0
| public void printStackTrace(PrintWriter s) {
|
45 |
0
| super.printStackTrace(s);
|
46 |
0
| if (this.reason != null) {
|
47 |
0
| s.print("Caused by: ");
|
48 |
0
| this.reason.printStackTrace(s);
|
49 |
| } |
50 |
| } |
51 |
| |
52 |
0
| public Exception getReason() {
|
53 |
0
| return reason;
|
54 |
| } |
55 |
| |
56 |
0
| public void setSeverity(int severity) {
|
57 |
0
| this.severity = severity;
|
58 |
| } |
59 |
| |
60 |
0
| public int getSeverity() {
|
61 |
0
| return severity;
|
62 |
| } |
63 |
| } |