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