KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > pmd > ast > ASTClassOrInterfaceBodyDeclaration


1 /* Generated By:JJTree: Do not edit this line. ASTClassOrInterfaceBodyDeclaration.java */
2
3 package net.sourceforge.pmd.ast;
4
5 import net.sourceforge.pmd.Rule;
6
7 public class ASTClassOrInterfaceBodyDeclaration extends SimpleJavaNode implements CanSuppressWarnings {
8
9     public ASTClassOrInterfaceBodyDeclaration(int id) {
10         super(id);
11     }
12
13     public ASTClassOrInterfaceBodyDeclaration(JavaParser p, int id) {
14         super(p, id);
15     }
16
17
18     public boolean hasSuppressWarningsAnnotationFor(Rule rule) {
19         for (int i = 0; i < jjtGetNumChildren(); i++) {
20             if (jjtGetChild(i) instanceof ASTAnnotation) {
21                 ASTAnnotation a = (ASTAnnotation) jjtGetChild(i);
22                 if (a.suppresses(rule)) {
23                     return true;
24                 }
25             }
26         }
27         return false;
28     }
29
30     /**
31      * Accept the visitor. *
32      */

33     public Object JavaDoc jjtAccept(JavaParserVisitor visitor, Object JavaDoc data) {
34         return visitor.visit(this, data);
35     }
36
37     public boolean isAnonymousInnerClass() {
38         return jjtGetParent().jjtGetParent() instanceof ASTAllocationExpression;
39     }
40
41     public boolean isEnumChild() {
42         return jjtGetParent().jjtGetParent() instanceof ASTEnumConstant;
43     }
44
45     public void dump(String JavaDoc prefix) {
46         String JavaDoc isAnonyString = isAnonymousInnerClass() ? ": (anonymous inner class)" : "";
47         System.out.println(toString(prefix) + isAnonyString);
48         dumpChildren(prefix);
49     }
50
51 }
52
Popular Tags