63 import com.sun.tools.javac.util.Name; |
63 import com.sun.tools.javac.util.Name; |
64 import com.sun.tools.javac.util.Names; |
64 import com.sun.tools.javac.util.Names; |
65 import com.sun.tools.javac.util.Position; |
65 import com.sun.tools.javac.util.Position; |
66 |
66 |
67 import static com.sun.tools.javac.code.Kinds.*; |
67 import static com.sun.tools.javac.code.Kinds.*; |
|
68 import static com.sun.tools.javac.tree.JCTree.Tag.*; |
68 |
69 |
69 /** |
70 /** |
70 * Represents a java class and provides access to information |
71 * Represents a java class and provides access to information |
71 * about the class, the class' comment and tags, and the |
72 * about the class, the class' comment and tags, and the |
72 * members of the class. A ClassDocImpl only exists if it was |
73 * members of the class. A ClassDocImpl only exists if it was |
1081 Env<AttrContext> compenv = env.enter.getEnv(tsym); |
1082 Env<AttrContext> compenv = env.enter.getEnv(tsym); |
1082 if (compenv == null) return new ClassDocImpl[0]; |
1083 if (compenv == null) return new ClassDocImpl[0]; |
1083 |
1084 |
1084 Name asterisk = tsym.name.table.names.asterisk; |
1085 Name asterisk = tsym.name.table.names.asterisk; |
1085 for (JCTree t : compenv.toplevel.defs) { |
1086 for (JCTree t : compenv.toplevel.defs) { |
1086 if (t.getTag() == JCTree.IMPORT) { |
1087 if (t.hasTag(IMPORT)) { |
1087 JCTree imp = ((JCImport) t).qualid; |
1088 JCTree imp = ((JCImport) t).qualid; |
1088 if ((TreeInfo.name(imp) != asterisk) && |
1089 if ((TreeInfo.name(imp) != asterisk) && |
1089 (imp.type.tsym.kind & Kinds.TYP) != 0) { |
1090 (imp.type.tsym.kind & Kinds.TYP) != 0) { |
1090 importedClasses.append( |
1091 importedClasses.append( |
1091 env.getClassDoc((ClassSymbol)imp.type.tsym)); |
1092 env.getClassDoc((ClassSymbol)imp.type.tsym)); |
1122 |
1123 |
1123 Env<AttrContext> compenv = env.enter.getEnv(tsym); |
1124 Env<AttrContext> compenv = env.enter.getEnv(tsym); |
1124 if (compenv == null) return new PackageDocImpl[0]; |
1125 if (compenv == null) return new PackageDocImpl[0]; |
1125 |
1126 |
1126 for (JCTree t : compenv.toplevel.defs) { |
1127 for (JCTree t : compenv.toplevel.defs) { |
1127 if (t.getTag() == JCTree.IMPORT) { |
1128 if (t.hasTag(IMPORT)) { |
1128 JCTree imp = ((JCImport) t).qualid; |
1129 JCTree imp = ((JCImport) t).qualid; |
1129 if (TreeInfo.name(imp) == names.asterisk) { |
1130 if (TreeInfo.name(imp) == names.asterisk) { |
1130 JCFieldAccess sel = (JCFieldAccess)imp; |
1131 JCFieldAccess sel = (JCFieldAccess)imp; |
1131 Symbol s = sel.selected.type.tsym; |
1132 Symbol s = sel.selected.type.tsym; |
1132 PackageDocImpl pdoc = env.getPackageDoc(s.packge()); |
1133 PackageDocImpl pdoc = env.getPackageDoc(s.packge()); |