/** * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit) */ public boolean visit(CompilationUnit node) { // visit only the type declarations List types = node.types(); for (Iterator iter = types.iterator(); iter.hasNext() && !fFound;) { ((TypeDeclaration) iter.next()).accept(this); } return false; }
/** * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.CompilationUnit) */ public boolean visit(CompilationUnit node) { // visit only the type declarations List types = node.types(); for (Iterator iter = types.iterator(); iter.hasNext() && !fFound;) { ((TypeDeclaration) iter.next()).accept(this); } return false; }
@Override public void parse() { MethodVisitor methodVisitor = new MethodVisitor(typeDeclaration, this); typeDeclaration.accept(methodVisitor); List<SM_Method> mList = methodVisitor.getMethods(); if (mList.size() > 0) methodList.addAll(mList); parseMethods(); FieldVisitor fieldVisitor = new FieldVisitor(this); typeDeclaration.accept(fieldVisitor); List<SM_Field> fList = fieldVisitor.getFields(); if (fList.size() > 0) fieldList.addAll(fList); parseFields(); StaticFieldAccessVisitor fieldAccessVisitor = new StaticFieldAccessVisitor(); typeDeclaration.accept(fieldAccessVisitor); staticFieldAccesses = fieldAccessVisitor.getStaticFieldAccesses(); }
typeDecl.accept(new ListClassVisitor());
/** * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration) */ public boolean visit(TypeDeclaration node) { if (containsPosition(node)) { // visit the field declarations FieldDeclaration[] fields = node.getFields(); for (int i = 0, length = fields.length; i < length && !fFound; i++) { fields[i].accept(this); } if (!fFound) { // visit inner types TypeDeclaration[] types = node.getTypes(); for (int i = 0, length = types.length; i < length && !fFound; i++) { types[i].accept(this); } } } return false; }
/** * @see org.eclipse.jdt.core.dom.ASTVisitor#visit(org.eclipse.jdt.core.dom.TypeDeclaration) */ public boolean visit(TypeDeclaration node) { if (containsPosition(node)) { // visit the methode declarations MethodDeclaration[] methods = node.getMethods(); for (int i = 0, length = methods.length; i < length && !fFound; i++) { methods[i].accept(this); } if (!fFound) { // visit inner types TypeDeclaration[] types = node.getTypes(); for (int i = 0, length = types.length; i < length && !fFound; i++) { types[i].accept(this); } } } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= JLS3) { node.getDeclaration().accept(this); } return false; }
for (TypeDeclaration typeDecl : env.getSpecifiedTypeDeclarations()) { System.out.println("in class: " + typeDecl); typeDecl.accept(getDeclarationScanner( new SomeClassVisitor(), NO_OP));
@Override public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= JLS3) { node.getDeclaration().accept(this); } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= JLS3) { node.getDeclaration().accept(this); } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= JLS3) { node.getDeclaration().accept(this); } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == AST.JLS2) { node.getTypeDeclaration().accept(this); } if (node.getAST().apiLevel() >= AST.JLS3) { node.getDeclaration().accept(this); } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= JLS3) { node.getDeclaration().accept(this); } return false; }
public boolean visit(TypeDeclarationStatement node) { if (node.getAST().apiLevel() == JLS2) { getTypeDeclaration(node).accept(this); } if (node.getAST().apiLevel() >= AST.JLS3) { node.getDeclaration().accept(this); } return false; }
@Override public boolean visit(TypeDeclaration node) { final ITypeBinding typeBinding = node.resolveBinding(); if (typeBinding != null && !typeBinding.isNested() && node.getParent() instanceof CompilationUnit) { final CompilationUnit compilationUnit = (CompilationUnit) node.getParent(); for (final ImportDeclaration importDecl : imports(compilationUnit)) { readImport(importDecl); } importTypesFromPackage("java.lang", compilationUnit); node.accept(new NamesCollector()); } return VISIT_SUBTREE; }
typeDeclaration.accept(visitor); Set<AnonymousClassDeclaration> anonymousClassDeclarations = visitor.getAnonymousClassDeclarations();