|
1 |
| |
|
2 |
| |
|
3 |
| package net.sourceforge.pmd.ast; |
|
4 |
| |
|
5 |
| import net.sourceforge.pmd.Rule; |
|
6 |
| |
|
7 |
| public class ASTAnnotation extends SimpleJavaNode { |
|
8 |
0
| public ASTAnnotation(int id) {
|
|
9 |
0
| super(id);
|
|
10 |
| } |
|
11 |
| |
|
12 |
17
| public ASTAnnotation(JavaParser p, int id) {
|
|
13 |
17
| super(p, id);
|
|
14 |
| } |
|
15 |
| |
|
16 |
| |
|
17 |
10
| public boolean suppresses(Rule rule) {
|
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| |
|
24 |
| |
|
25 |
10
| if (jjtGetChild(0) instanceof ASTSingleMemberAnnotation) {
|
|
26 |
10
| ASTSingleMemberAnnotation n = (ASTSingleMemberAnnotation) jjtGetChild(0);
|
|
27 |
10
| if (n.jjtGetChild(0) instanceof ASTName && ((ASTName) n.jjtGetChild(0)).getImage().equals("SuppressWarnings")) {
|
|
28 |
10
| return true;
|
|
29 |
| } |
|
30 |
0
| return false;
|
|
31 |
| } |
|
32 |
| |
|
33 |
| |
|
34 |
| |
|
35 |
| |
|
36 |
| |
|
37 |
| |
|
38 |
| |
|
39 |
| |
|
40 |
| |
|
41 |
| |
|
42 |
| |
|
43 |
| |
|
44 |
| |
|
45 |
| |
|
46 |
| |
|
47 |
| |
|
48 |
| |
|
49 |
| |
|
50 |
| |
|
51 |
| |
|
52 |
| |
|
53 |
| |
|
54 |
| |
|
55 |
| |
|
56 |
| |
|
57 |
| |
|
58 |
| |
|
59 |
| |
|
60 |
| |
|
61 |
| |
|
62 |
0
| return false;
|
|
63 |
| } |
|
64 |
| |
|
65 |
| |
|
66 |
| |
|
67 |
| |
|
68 |
| |
|
69 |
38
| public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
|
70 |
38
| return visitor.visit(this, data);
|
|
71 |
| } |
|
72 |
| } |