View Javadoc

    1   /* Generated By:JJTree: Do not edit this line. ASTCompilationUnit.java */
    2
    3   package net.sourceforge.pmd.ast;
    4
    5   import java.util.List;
    6   import net.sourceforge.pmd.typeresolution.ClassTypeResolver;
    7
    8   // FUTURE Change this class to extend from SimpleJavaNode, as TypeNode is not appropriate (unless I'm wrong)
    9   public class ASTCompilationUnit extends SimpleJavaTypeNode implements CompilationUnit {
    10
    11      private ClassTypeResolver classTypeResolver;
    12
    13      public ASTCompilationUnit(int id) {
    14          super(id);
    15      }
    16
    17      public ASTCompilationUnit(JavaParser p, int id) {
    18          super(p, id);
    19      }
    20
    21      private List<Comment> comments;
    22
    23      public List<Comment> getComments() {
    24          return comments;
    25      }
    26
    27      public void setComments(List<Comment> comments) {
    28          this.comments = comments;
    29      }
    30
    31      /**
    32       * Accept the visitor. *
    33       */
    34      public Object jjtAccept(JavaParserVisitor visitor, Object data) {
    35          return visitor.visit(this, data);
    36      }
    37
    38      public boolean declarationsAreInDefaultPackage() {
    39          return getPackageDeclaration() == null;
    40      }
    41
    42      public ASTPackageDeclaration getPackageDeclaration() {
    43          return getFirstChildOfType(ASTPackageDeclaration.class);
    44      }
    45
    46      public ClassTypeResolver getClassTypeResolver() {
    47      	return classTypeResolver;
    48      }
    49
    50      public void setClassTypeResolver(ClassTypeResolver classTypeResolver) {
    51      	this.classTypeResolver = classTypeResolver;
    52      }
    53  }