@Override
 public void visit(final AnnotationDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, arg);
   n.getNameExpr().accept(this, arg);
   if (n.getMembers() != null) {
     for (final BodyDeclaration<?> member : n.getMembers()) {
       member.accept(this, arg);
     }
   }
 }
 @Override
 public void visit(final EnumConstantDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, arg);
   if (n.getArgs() != null) {
     for (final Expression e : n.getArgs()) {
       e.accept(this, arg);
     }
   }
   if (n.getClassBody() != null) {
     for (final BodyDeclaration<?> member : n.getClassBody()) {
       member.accept(this, arg);
     }
   }
 }
 @Override
 public void visit(final ClassOrInterfaceDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, arg);
   n.getNameExpr().accept(this, arg);
   for (final TypeParameter t : n.getTypeParameters()) {
     t.accept(this, arg);
   }
   for (final ClassOrInterfaceType c : n.getExtends()) {
     c.accept(this, arg);
   }
   for (final ClassOrInterfaceType c : n.getImplements()) {
     c.accept(this, arg);
   }
   for (final BodyDeclaration<?> member : n.getMembers()) {
     member.accept(this, arg);
   }
 }
 @Override
 public void visit(final EnumDeclaration n, final A arg) {
   visitComment(n.getComment(), arg);
   visitAnnotations(n, arg);
   n.getNameExpr().accept(this, arg);
   if (n.getImplements() != null) {
     for (final ClassOrInterfaceType c : n.getImplements()) {
       c.accept(this, arg);
     }
   }
   if (n.getEntries() != null) {
     for (final EnumConstantDeclaration e : n.getEntries()) {
       e.accept(this, arg);
     }
   }
   if (n.getMembers() != null) {
     for (final BodyDeclaration<?> member : n.getMembers()) {
       member.accept(this, arg);
     }
   }
 }
 @Override
 public void visit(final ObjectCreationExpr n, final A arg) {
   visitComment(n.getComment(), arg);
   if (n.getScope() != null) {
     n.getScope().accept(this, arg);
   }
   if (n.getTypeArguments() != null) {
     for (final Type t : n.getTypeArguments()) {
       t.accept(this, arg);
     }
   }
   n.getType().accept(this, arg);
   if (n.getArgs() != null) {
     for (final Expression e : n.getArgs()) {
       e.accept(this, arg);
     }
   }
   if (n.getAnonymousClassBody() != null) {
     for (final BodyDeclaration<?> member : n.getAnonymousClassBody()) {
       member.accept(this, arg);
     }
   }
 }
Example #6
0
 private void addMember(BodyDeclaration bodyDeclaration) {
   bodyDeclaration.setParentNode(type.get());
   type.get().getMembers().add(bodyDeclaration);
 }