1 |
| |
2 |
| |
3 |
| package net.sourceforge.pmd.ast; |
4 |
| |
5 |
| public class ASTClassOrInterfaceDeclaration extends AccessNode { |
6 |
0
| public ASTClassOrInterfaceDeclaration(int id) {
|
7 |
0
| super(id);
|
8 |
| } |
9 |
| |
10 |
1268
| public ASTClassOrInterfaceDeclaration(JavaParser p, int id) {
|
11 |
1268
| super(p, id);
|
12 |
| } |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
3095
| public Object jjtAccept(JavaParserVisitor visitor, Object data) {
|
18 |
3095
| return visitor.visit(this, data);
|
19 |
| } |
20 |
| |
21 |
75
| public boolean isNested() {
|
22 |
75
| return jjtGetParent() instanceof ASTClassOrInterfaceBodyDeclaration;
|
23 |
| } |
24 |
| |
25 |
| private boolean isInterface; |
26 |
| |
27 |
814
| public boolean isInterface() {
|
28 |
814
| return this.isInterface;
|
29 |
| } |
30 |
| |
31 |
54
| public void setInterface() {
|
32 |
54
| this.isInterface = true;
|
33 |
| } |
34 |
| |
35 |
0
| public void dump(String prefix) {
|
36 |
0
| String interfaceStr = isInterface ? "interface" : "class";
|
37 |
0
| String innerStr = isNested() ? "(nested)" : "";
|
38 |
0
| System.out.println(toString(prefix) + "(" + getImage() + ")(" + interfaceStr + ")" + innerStr);
|
39 |
0
| dumpChildren(prefix);
|
40 |
| } |
41 |
| |
42 |
| } |