01: package tide.exttools.PMD;
02:
03: import javax.swing.tree.DefaultMutableTreeNode;
04:
05: public final class Rule extends DefaultMutableTreeNode {
06: String name;
07: String message;
08: String description;
09: String priority;
10: String reference = null;
11:
12: boolean selected = false;
13:
14: public Rule(String name, String message, String description) {
15: super (name);
16:
17: this .message = message;
18: this .description = description;
19: this .name = name;
20: }
21:
22: public Rule() {
23: super (null);
24: }
25:
26: public void setName(String n) {
27: name = n;
28: this .setUserObject(name);
29: }
30:
31: public void setDescription(String n) {
32: description = n;
33: }
34:
35: public void setMessage(String a) {
36: this .message = a;
37: }
38:
39: public void setPriority(String a) {
40: this .priority = a;
41: }
42:
43: public void setReference(String a) {
44: this .reference = a;
45: }
46:
47: @Override
48: public final String toString() {
49: if (reference != null)
50: return "REF " + reference;
51: return name + " (" + priority + ")";
52: }
53:
54: public final String toStringDetails() {
55: StringBuilder sb = new StringBuilder();
56: sb.append("\nRule " + name + ", m=" + message + ", d="
57: + description + ", p=" + priority);
58: return sb.toString();
59: }
60:
61: }
|