@Override public void visitVarDef(JCVariableDecl tree) { super.visitVarDef(tree); if (tree.sym != null && tree.sym.kind == Kinds.VAR && !isParameter(tree.sym)) { docenv.makeFieldDoc(tree.sym, docenv.getTreePath(env.toplevel, env.enclClass, tree)); } }
@Override public void visitTopLevel(JCCompilationUnit tree) { super.visitTopLevel(tree); if (tree.sourcefile.isNameCompatible("package-info", JavaFileObject.Kind.SOURCE)) { docenv.makePackageDoc(tree.packge, docenv.getTreePath(tree)); } }
@Override public void visitClassDef(JCClassDecl tree) { super.visitClassDef(tree); if (tree.sym == null) return; if (tree.sym.kind == Kinds.TYP || tree.sym.kind == Kinds.ERR) { ClassSymbol c = tree.sym; docenv.makeClassDoc(c, docenv.getTreePath(env.toplevel, tree)); } }
@Override public void visitMethodDef(JCMethodDecl tree) { super.visitMethodDef(tree); MethodSymbol meth = tree.sym; if (meth == null || meth.kind != Kinds.MTH) return; TreePath treePath = docenv.getTreePath(env.toplevel, env.enclClass, tree); if (meth.isConstructor()) docenv.makeConstructorDoc(meth, treePath); else if (isAnnotationTypeElement(meth)) docenv.makeAnnotationTypeElementDoc(meth, treePath); else docenv.makeMethodDoc(meth, treePath); // release resources tree.body = null; }