author | jlahoda |
Fri, 09 Mar 2018 09:42:10 +0100 | |
changeset 49197 | cc2673fa8c20 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
43265
4ec472ee5135
8169608: Compiler Tree API's Doctrees.getDocTreePath needs to accept a PackageElement
ksrini
parents:
42277
diff
changeset
|
2 |
* Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. |
10 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5520 | 7 |
* published by the Free Software Foundation. Oracle designates this |
10 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5520 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
10 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5520 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
10 | 24 |
*/ |
25 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
26 |
package jdk.javadoc.internal.tool; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
27 |
|
10 | 28 |
|
29 |
import java.util.*; |
|
14802 | 30 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
31 |
import javax.lang.model.element.Element; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
32 |
import javax.lang.model.element.TypeElement; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
33 |
import javax.lang.model.util.Elements; |
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1264
diff
changeset
|
34 |
import javax.tools.JavaFileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
35 |
import javax.tools.JavaFileObject; |
42277 | 36 |
import javax.tools.JavaFileObject.Kind; |
10 | 37 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
38 |
import com.sun.source.util.DocTrees; |
14802 | 39 |
import com.sun.source.util.TreePath; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
40 |
import com.sun.tools.javac.api.JavacTrees; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
41 |
import com.sun.tools.javac.code.ClassFinder; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
42 |
import com.sun.tools.javac.code.Flags; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
43 |
import com.sun.tools.javac.code.Source; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
44 |
import com.sun.tools.javac.code.Symbol; |
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
45 |
import com.sun.tools.javac.code.Symbol.ClassSymbol; |
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
46 |
import com.sun.tools.javac.code.Symbol.CompletionFailure; |
36526 | 47 |
import com.sun.tools.javac.code.Symbol.ModuleSymbol; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
48 |
import com.sun.tools.javac.code.Symtab; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
49 |
import com.sun.tools.javac.comp.AttrContext; |
10 | 50 |
import com.sun.tools.javac.comp.Check; |
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
51 |
import com.sun.tools.javac.comp.Enter; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
52 |
import com.sun.tools.javac.comp.Env; |
21891
42435b2c96cf
8027977: javadoc dies on NumberFormat/DateFormat subclass
bpatel
parents:
21500
diff
changeset
|
53 |
import com.sun.tools.javac.file.JavacFileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
54 |
import com.sun.tools.javac.model.JavacElements; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
55 |
import com.sun.tools.javac.model.JavacTypes; |
14802 | 56 |
import com.sun.tools.javac.tree.JCTree; |
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
57 |
import com.sun.tools.javac.tree.JCTree.JCClassDecl; |
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
58 |
import com.sun.tools.javac.tree.JCTree.JCCompilationUnit; |
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
59 |
import com.sun.tools.javac.tree.JCTree.JCPackageDecl; |
10 | 60 |
import com.sun.tools.javac.util.Context; |
36526 | 61 |
import com.sun.tools.javac.util.Convert; |
62 |
import com.sun.tools.javac.util.Name; |
|
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
10
diff
changeset
|
63 |
import com.sun.tools.javac.util.Names; |
10 | 64 |
|
65 |
/** |
|
66 |
* Holds the environment for a run of javadoc. |
|
67 |
* Holds only the information needed throughout the |
|
68 |
* run and not the compiler info that could be GC'ed |
|
69 |
* or ported. |
|
70 |
* |
|
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
10189
diff
changeset
|
71 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
10189
diff
changeset
|
72 |
* If you write code that depends on this, you do so at your own risk. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
10189
diff
changeset
|
73 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
10189
diff
changeset
|
74 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
10189
diff
changeset
|
75 |
* |
10 | 76 |
* @author Robert Field |
77 |
* @author Neal Gafter (rewrite) |
|
78 |
* @author Scott Seligman (generics) |
|
79 |
*/ |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
80 |
public class ToolEnvironment { |
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
81 |
protected static final Context.Key<ToolEnvironment> ToolEnvKey = new Context.Key<>(); |
10 | 82 |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
83 |
public static ToolEnvironment instance(Context context) { |
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
84 |
ToolEnvironment instance = context.get(ToolEnvKey); |
10 | 85 |
if (instance == null) |
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
86 |
instance = new ToolEnvironment(context); |
10 | 87 |
return instance; |
88 |
} |
|
89 |
||
41451 | 90 |
final Messager messager; |
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
91 |
|
10 | 92 |
/** Predefined symbols known to the compiler. */ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
93 |
public final Symtab syms; |
10 | 94 |
|
95 |
/** Referenced directly in RootDocImpl. */ |
|
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
96 |
private final ClassFinder finder; |
10 | 97 |
|
98 |
/** Javadoc's own version of the compiler's enter phase. */ |
|
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
99 |
final Enter enter; |
10 | 100 |
|
101 |
/** The name table. */ |
|
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
102 |
private Names names; |
10 | 103 |
|
104 |
final Symbol externalizableSym; |
|
105 |
||
44287
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
43265
diff
changeset
|
106 |
/** If true, prevent printing of any notifications. */ |
10 | 107 |
boolean quiet = false; |
108 |
||
44287
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
43265
diff
changeset
|
109 |
/** If true, ignore all errors encountered during Enter. */ |
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
43265
diff
changeset
|
110 |
boolean ignoreSourceErrors = false; |
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
43265
diff
changeset
|
111 |
|
10 | 112 |
Check chk; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
113 |
com.sun.tools.javac.code.Types types; |
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1264
diff
changeset
|
114 |
JavaFileManager fileManager; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
115 |
public final Context context; |
10 | 116 |
|
22163 | 117 |
WeakHashMap<JCTree, TreePath> treePaths = new WeakHashMap<>(); |
14802 | 118 |
|
10 | 119 |
/** Allow documenting from class files? */ |
120 |
boolean docClasses = false; |
|
121 |
||
122 |
/** |
|
19912
4b1a79163f9c
8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents:
16799
diff
changeset
|
123 |
* The source language version. |
4b1a79163f9c
8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents:
16799
diff
changeset
|
124 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
125 |
public final Source source; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
126 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
127 |
public final Elements elements; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
128 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
129 |
public final JavacTypes typeutils; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
130 |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
131 |
protected DocEnvImpl docEnv; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
132 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
133 |
public final DocTrees docTrees; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
134 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
135 |
public final Map<Element, TreePath> elementToTreePath; |
19912
4b1a79163f9c
8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents:
16799
diff
changeset
|
136 |
|
4b1a79163f9c
8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents:
16799
diff
changeset
|
137 |
/** |
10 | 138 |
* Constructor |
139 |
* |
|
140 |
* @param context Context for this javadoc instance. |
|
141 |
*/ |
|
39364
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
142 |
protected ToolEnvironment(Context context) { |
bd6d4a7936b4
8160301: javadoc RootDoclmpl and DocEnv needs to be renamed
ksrini
parents:
37750
diff
changeset
|
143 |
context.put(ToolEnvKey, this); |
14541
36f9d11fc9aa
7021614: extend com.sun.source API to support parsing javadoc comments
jjg
parents:
14260
diff
changeset
|
144 |
this.context = context; |
10 | 145 |
|
146 |
messager = Messager.instance0(context); |
|
147 |
syms = Symtab.instance(context); |
|
24604
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
148 |
finder = JavadocClassFinder.instance(context); |
7f68545b5128
8041422: Split javac ClassReader into ClassReader+ClassFinder
jjg
parents:
24069
diff
changeset
|
149 |
enter = JavadocEnter.instance(context); |
1260
a772ba9ba43d
6574134: Allow for alternative implementation of Name Table with garbage collection of name bytes
jjg
parents:
10
diff
changeset
|
150 |
names = Names.instance(context); |
36526 | 151 |
externalizableSym = syms.enterClass(syms.java_base, names.fromString("java.io.Externalizable")); |
10 | 152 |
chk = Check.instance(context); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
153 |
types = com.sun.tools.javac.code.Types.instance(context); |
1869
0e193a8f3520
6794582: javadoc should read files using a FileManager
jjg
parents:
1264
diff
changeset
|
154 |
fileManager = context.get(JavaFileManager.class); |
21891
42435b2c96cf
8027977: javadoc dies on NumberFormat/DateFormat subclass
bpatel
parents:
21500
diff
changeset
|
155 |
if (fileManager instanceof JavacFileManager) { |
42435b2c96cf
8027977: javadoc dies on NumberFormat/DateFormat subclass
bpatel
parents:
21500
diff
changeset
|
156 |
((JavacFileManager)fileManager).setSymbolFileEnabled(false); |
42435b2c96cf
8027977: javadoc dies on NumberFormat/DateFormat subclass
bpatel
parents:
21500
diff
changeset
|
157 |
} |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
158 |
docTrees = JavacTrees.instance(context); |
19912
4b1a79163f9c
8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents:
16799
diff
changeset
|
159 |
source = Source.instance(context); |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
160 |
elements = JavacElements.instance(context); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
161 |
typeutils = JavacTypes.instance(context); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
162 |
elementToTreePath = new HashMap<>(); |
10 | 163 |
} |
164 |
||
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
39364
diff
changeset
|
165 |
public void initialize(Map<ToolOption, Object> toolOpts) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
39364
diff
changeset
|
166 |
this.quiet = (boolean)toolOpts.getOrDefault(ToolOption.QUIET, false); |
44287
829205b133d4
8175219: javadoc should exit when it encounters compilation errors.
ksrini
parents:
43265
diff
changeset
|
167 |
this.ignoreSourceErrors = (boolean)toolOpts.getOrDefault(ToolOption.IGNORE_SOURCE_ERRORS, false); |
10 | 168 |
} |
169 |
||
170 |
/** |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
171 |
* Load a class by qualified name. |
10 | 172 |
*/ |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
173 |
public TypeElement loadClass(String name) { |
10 | 174 |
try { |
36526 | 175 |
Name nameImpl = names.fromString(name); |
176 |
ModuleSymbol mod = syms.inferModule(Convert.packagePart(nameImpl)); |
|
177 |
ClassSymbol c = finder.loadClass(mod != null ? mod : syms.errModule, nameImpl); |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
178 |
return c; |
10 | 179 |
} catch (CompletionFailure ex) { |
180 |
chk.completionError(null, ex); |
|
181 |
return null; |
|
182 |
} |
|
183 |
} |
|
184 |
||
40508
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
39364
diff
changeset
|
185 |
boolean isSynthetic(Symbol sym) { |
74ef30d16fb9
8159305: Enhance the javadoc tool to support module related options
ksrini
parents:
39364
diff
changeset
|
186 |
return (sym.flags() & Flags.SYNTHETIC) != 0; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
187 |
} |
10 | 188 |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
189 |
void setElementToTreePath(Element e, TreePath tree) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
190 |
if (e == null || tree == null) |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
191 |
return; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
192 |
elementToTreePath.put(e, tree); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
193 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
194 |
|
42277 | 195 |
public Kind getFileKind(TypeElement te) { |
196 |
JavaFileObject jfo = ((ClassSymbol)te).outermostClass().classfile; |
|
197 |
return jfo == null ? Kind.SOURCE : jfo.getKind(); |
|
198 |
} |
|
43265
4ec472ee5135
8169608: Compiler Tree API's Doctrees.getDocTreePath needs to accept a PackageElement
ksrini
parents:
42277
diff
changeset
|
199 |
|
10 | 200 |
/** |
41451 | 201 |
* Print a notice, iff <em>quiet</em> is not specified. |
10 | 202 |
* |
203 |
* @param key selects message from resource |
|
204 |
*/ |
|
205 |
public void notice(String key) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
206 |
if (quiet) { |
10 | 207 |
return; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
208 |
} |
10 | 209 |
messager.notice(key); |
210 |
} |
|
211 |
||
212 |
/** |
|
41451 | 213 |
* Print a notice, iff <em>quiet</em> is not specified. |
10 | 214 |
* |
215 |
* @param key selects message from resource |
|
216 |
* @param a1 first argument |
|
217 |
*/ |
|
218 |
public void notice(String key, String a1) { |
|
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
219 |
if (quiet) { |
10 | 220 |
return; |
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
221 |
} |
10 | 222 |
messager.notice(key, a1); |
223 |
} |
|
224 |
||
14802 | 225 |
TreePath getTreePath(JCCompilationUnit tree) { |
226 |
TreePath p = treePaths.get(tree); |
|
227 |
if (p == null) |
|
228 |
treePaths.put(tree, p = new TreePath(tree)); |
|
229 |
return p; |
|
230 |
} |
|
231 |
||
24069 | 232 |
TreePath getTreePath(JCCompilationUnit toplevel, JCPackageDecl tree) { |
233 |
TreePath p = treePaths.get(tree); |
|
234 |
if (p == null) |
|
235 |
treePaths.put(tree, p = new TreePath(getTreePath(toplevel), tree)); |
|
236 |
return p; |
|
237 |
} |
|
238 |
||
15354 | 239 |
TreePath getTreePath(JCCompilationUnit toplevel, JCClassDecl tree) { |
240 |
TreePath p = treePaths.get(tree); |
|
241 |
if (p == null) |
|
242 |
treePaths.put(tree, p = new TreePath(getTreePath(toplevel), tree)); |
|
243 |
return p; |
|
244 |
} |
|
245 |
||
246 |
TreePath getTreePath(JCCompilationUnit toplevel, JCClassDecl cdecl, JCTree tree) { |
|
247 |
return new TreePath(getTreePath(toplevel, cdecl), tree); |
|
14802 | 248 |
} |
249 |
||
35426
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
250 |
public com.sun.tools.javac.code.Types getTypes() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
251 |
return types; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
252 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
253 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
254 |
public Env<AttrContext> getEnv(ClassSymbol tsym) { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
255 |
return enter.getEnv(tsym); |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
256 |
} |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
257 |
|
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
258 |
public boolean isQuiet() { |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
259 |
return quiet; |
374342e56a56
8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents:
31752
diff
changeset
|
260 |
} |
10 | 261 |
} |