@Override
 public void visit(final CompilationUnit n, final A arg) {
   visitComment(n.getComment(), arg);
   if (n.getPackage() != null) {
     n.getPackage().accept(this, arg);
   }
   if (n.getImports() != null) {
     for (final ImportDeclaration i : n.getImports()) {
       i.accept(this, arg);
     }
   }
   if (n.getTypes() != null) {
     for (final TypeDeclaration<?> typeDeclaration : n.getTypes()) {
       typeDeclaration.accept(this, arg);
     }
   }
 }
示例#2
0
 private void getJavaMethods(ArrayList<JavaMethod> methods, TypeDeclaration type) {
   classStack.push(type);
   if (type.getMembers() != null) {
     for (BodyDeclaration member : type.getMembers()) {
       if (member instanceof ClassOrInterfaceDeclaration || member instanceof EnumDeclaration) {
         getJavaMethods(methods, (TypeDeclaration) member);
       } else {
         if (member instanceof MethodDeclaration) {
           MethodDeclaration method = (MethodDeclaration) member;
           if (!ModifierSet.hasModifier(
               ((MethodDeclaration) member).getModifiers(), ModifierSet.NATIVE)) continue;
           methods.add(createMethod(method));
         }
       }
     }
   }
   classStack.pop();
 }