ASTParser parser = createASTParser(compUnit.getJavaProject(), compUnit, ASTParser.K_COMPILATION_UNIT);
ASTNode ast = parser.createAST(null);
if (ast instanceof CompilationUnit) {
CompilationUnit cu = (CompilationUnit) ast;
ASTFinder visitor = new ASTFinder(className);
cu.accept(visitor);
return visitor.getTypeDeclaration();
}
return null;
}