author | jlahoda |
Wed, 27 Aug 2014 07:44:00 +0200 | |
changeset 26266 | 2d24bda701dc |
parent 25874 | 83c19f00452c |
child 34752 | 9c262a013456 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22163
diff
changeset
|
2 |
* Copyright (c) 2002, 2014, 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 |
||
26 |
||
27 |
package com.sun.tools.javah; |
|
28 |
||
29 |
import java.util.*; |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
30 |
import javax.lang.model.element.Name; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
31 |
import javax.lang.model.element.TypeElement; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
32 |
import javax.lang.model.type.ArrayType; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
33 |
import javax.lang.model.type.DeclaredType; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
34 |
import javax.lang.model.type.NoType; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
35 |
import javax.lang.model.type.PrimitiveType; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
36 |
import javax.lang.model.type.TypeKind; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
37 |
import javax.lang.model.type.TypeMirror; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
38 |
import javax.lang.model.type.TypeVariable; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
39 |
import javax.lang.model.type.TypeVisitor; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
40 |
import javax.lang.model.util.Elements; |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22163
diff
changeset
|
41 |
import javax.lang.model.util.SimpleTypeVisitor9; |
10 | 42 |
|
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
43 |
import com.sun.tools.javac.util.DefinedBy; |
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
44 |
import com.sun.tools.javac.util.DefinedBy.Api; |
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
45 |
|
10 | 46 |
/** |
47 |
* Returns internal type signature. |
|
48 |
* |
|
5847
1908176fd6e3
6944312: Potential rebranding issues in openjdk/langtools repository sources
jjg
parents:
5841
diff
changeset
|
49 |
* <p><b>This is NOT part of any supported API. |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
50 |
* If you write code that depends on this, you do so at your own |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
51 |
* risk. This code and its internal interfaces are subject to change |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
52 |
* or deletion without notice.</b></p> |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
53 |
* |
10 | 54 |
* @author Sucheta Dambalkar |
55 |
*/ |
|
56 |
||
6930 | 57 |
public class TypeSignature { |
58 |
static class SignatureException extends Exception { |
|
59 |
private static final long serialVersionUID = 1L; |
|
60 |
SignatureException(String reason) { |
|
61 |
super(reason); |
|
62 |
} |
|
63 |
} |
|
10 | 64 |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
65 |
Elements elems; |
10 | 66 |
|
67 |
/* Signature Characters */ |
|
68 |
||
69 |
private static final String SIG_VOID = "V"; |
|
70 |
private static final String SIG_BOOLEAN = "Z"; |
|
71 |
private static final String SIG_BYTE = "B"; |
|
72 |
private static final String SIG_CHAR = "C"; |
|
73 |
private static final String SIG_SHORT = "S"; |
|
74 |
private static final String SIG_INT = "I"; |
|
75 |
private static final String SIG_LONG = "J"; |
|
76 |
private static final String SIG_FLOAT = "F"; |
|
77 |
private static final String SIG_DOUBLE = "D"; |
|
78 |
private static final String SIG_ARRAY = "["; |
|
79 |
private static final String SIG_CLASS = "L"; |
|
80 |
||
81 |
||
82 |
||
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
83 |
public TypeSignature(Elements elems){ |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
84 |
this.elems = elems; |
10 | 85 |
} |
86 |
||
87 |
/* |
|
88 |
* Returns the type signature of a field according to JVM specs |
|
89 |
*/ |
|
6930 | 90 |
public String getTypeSignature(String javasignature) throws SignatureException { |
10 | 91 |
return getParamJVMSignature(javasignature); |
92 |
} |
|
93 |
||
94 |
/* |
|
95 |
* Returns the type signature of a method according to JVM specs |
|
96 |
*/ |
|
6930 | 97 |
public String getTypeSignature(String javasignature, TypeMirror returnType) |
98 |
throws SignatureException { |
|
10 | 99 |
String signature = null; //Java type signature. |
100 |
String typeSignature = null; //Internal type signature. |
|
22163 | 101 |
List<String> params = new ArrayList<>(); //List of parameters. |
10 | 102 |
String paramsig = null; //Java parameter signature. |
103 |
String paramJVMSig = null; //Internal parameter signature. |
|
104 |
String returnSig = null; //Java return type signature. |
|
105 |
String returnJVMType = null; //Internal return type signature. |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
106 |
int dimensions = 0; //Array dimension. |
10 | 107 |
|
108 |
int startIndex = -1; |
|
109 |
int endIndex = -1; |
|
110 |
StringTokenizer st = null; |
|
111 |
int i = 0; |
|
112 |
||
113 |
// Gets the actual java signature without parentheses. |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
114 |
if (javasignature != null) { |
10 | 115 |
startIndex = javasignature.indexOf("("); |
116 |
endIndex = javasignature.indexOf(")"); |
|
117 |
} |
|
118 |
||
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
119 |
if (((startIndex != -1) && (endIndex != -1)) |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
120 |
&&(startIndex+1 < javasignature.length()) |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
121 |
&&(endIndex < javasignature.length())) { |
10 | 122 |
signature = javasignature.substring(startIndex+1, endIndex); |
123 |
} |
|
124 |
||
125 |
// Separates parameters. |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
126 |
if (signature != null) { |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
127 |
if (signature.contains(",")) { |
10 | 128 |
st = new StringTokenizer(signature, ","); |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
129 |
if (st != null) { |
10 | 130 |
while (st.hasMoreTokens()) { |
131 |
params.add(st.nextToken()); |
|
132 |
} |
|
133 |
} |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
134 |
} else { |
10 | 135 |
params.add(signature); |
136 |
} |
|
137 |
} |
|
138 |
||
139 |
/* JVM type signature. */ |
|
140 |
typeSignature = "("; |
|
141 |
||
142 |
// Gets indivisual internal parameter signature. |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
143 |
while (params.isEmpty() != true) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
144 |
paramsig = params.remove(i).trim(); |
10 | 145 |
paramJVMSig = getParamJVMSignature(paramsig); |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
146 |
if (paramJVMSig != null) { |
10 | 147 |
typeSignature += paramJVMSig; |
148 |
} |
|
149 |
} |
|
150 |
||
151 |
typeSignature += ")"; |
|
152 |
||
153 |
// Get internal return type signature. |
|
154 |
||
155 |
returnJVMType = ""; |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
156 |
if (returnType != null) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
157 |
dimensions = dimensions(returnType); |
10 | 158 |
} |
159 |
||
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
160 |
//Gets array dimension of return type. |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
161 |
while (dimensions-- > 0) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
162 |
returnJVMType += "["; |
10 | 163 |
} |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
164 |
if (returnType != null) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
165 |
returnSig = qualifiedTypeName(returnType); |
10 | 166 |
returnJVMType += getComponentType(returnSig); |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
167 |
} else { |
10 | 168 |
System.out.println("Invalid return type."); |
169 |
} |
|
170 |
||
171 |
typeSignature += returnJVMType; |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
172 |
|
10 | 173 |
return typeSignature; |
174 |
} |
|
175 |
||
176 |
/* |
|
177 |
* Returns internal signature of a parameter. |
|
178 |
*/ |
|
6930 | 179 |
private String getParamJVMSignature(String paramsig) throws SignatureException { |
10 | 180 |
String paramJVMSig = ""; |
181 |
String componentType =""; |
|
182 |
||
183 |
if(paramsig != null){ |
|
184 |
||
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
185 |
if(paramsig.contains("[]")) { |
10 | 186 |
// Gets array dimension. |
187 |
int endindex = paramsig.indexOf("[]"); |
|
188 |
componentType = paramsig.substring(0, endindex); |
|
189 |
String dimensionString = paramsig.substring(endindex); |
|
190 |
if(dimensionString != null){ |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
191 |
while(dimensionString.contains("[]")){ |
10 | 192 |
paramJVMSig += "["; |
193 |
int beginindex = dimensionString.indexOf("]") + 1; |
|
194 |
if(beginindex < dimensionString.length()){ |
|
195 |
dimensionString = dimensionString.substring(beginindex); |
|
196 |
}else |
|
197 |
dimensionString = ""; |
|
198 |
} |
|
199 |
} |
|
200 |
} else componentType = paramsig; |
|
201 |
||
202 |
paramJVMSig += getComponentType(componentType); |
|
203 |
} |
|
204 |
return paramJVMSig; |
|
205 |
} |
|
206 |
||
207 |
/* |
|
208 |
* Returns internal signature of a component. |
|
209 |
*/ |
|
6930 | 210 |
private String getComponentType(String componentType) throws SignatureException { |
10 | 211 |
|
212 |
String JVMSig = ""; |
|
213 |
||
214 |
if(componentType != null){ |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
215 |
switch (componentType) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
216 |
case "void": JVMSig += SIG_VOID; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
217 |
case "boolean": JVMSig += SIG_BOOLEAN; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
218 |
case "byte": JVMSig += SIG_BYTE; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
219 |
case "char": JVMSig += SIG_CHAR; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
220 |
case "short": JVMSig += SIG_SHORT; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
221 |
case "int": JVMSig += SIG_INT; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
222 |
case "long": JVMSig += SIG_LONG; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
223 |
case "float": JVMSig += SIG_FLOAT; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
224 |
case "double": JVMSig += SIG_DOUBLE; break; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
225 |
default: |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
226 |
if (!componentType.equals("")) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
227 |
TypeElement classNameDoc = elems.getTypeElement(componentType); |
10 | 228 |
|
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
229 |
if (classNameDoc == null) { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
230 |
throw new SignatureException(componentType); |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
231 |
} |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
232 |
else { |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
233 |
String classname = classNameDoc.getQualifiedName().toString(); |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
234 |
String newclassname = classname.replace('.', '/'); |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
235 |
JVMSig += "L"; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
236 |
JVMSig += newclassname; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
237 |
JVMSig += ";"; |
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
238 |
} |
10 | 239 |
} |
22159
682da512ec17
8030253: Update langtools to use strings-in-switch
briangoetz
parents:
10192
diff
changeset
|
240 |
break; |
10 | 241 |
} |
242 |
} |
|
243 |
return JVMSig; |
|
244 |
} |
|
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
245 |
|
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
246 |
int dimensions(TypeMirror t) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
247 |
if (t.getKind() != TypeKind.ARRAY) |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
248 |
return 0; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
249 |
return 1 + dimensions(((ArrayType) t).getComponentType()); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
250 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
251 |
|
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
252 |
|
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
253 |
String qualifiedTypeName(TypeMirror type) { |
25690
b1dac768ab79
8050430: Provided new utility visitors supporting SourceVersion.RELEASE_9
darcy
parents:
22163
diff
changeset
|
254 |
TypeVisitor<Name, Void> v = new SimpleTypeVisitor9<Name, Void>() { |
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
255 |
@Override @DefinedBy(Api.LANGUAGE_MODEL) |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
256 |
public Name visitArray(ArrayType t, Void p) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
257 |
return t.getComponentType().accept(this, p); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
258 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
259 |
|
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
260 |
@Override @DefinedBy(Api.LANGUAGE_MODEL) |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
261 |
public Name visitDeclared(DeclaredType t, Void p) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
262 |
return ((TypeElement) t.asElement()).getQualifiedName(); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
263 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
264 |
|
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
265 |
@Override @DefinedBy(Api.LANGUAGE_MODEL) |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
266 |
public Name visitPrimitive(PrimitiveType t, Void p) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
267 |
return elems.getName(t.toString()); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
268 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
269 |
|
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
270 |
@Override @DefinedBy(Api.LANGUAGE_MODEL) |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
271 |
public Name visitNoType(NoType t, Void p) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
272 |
if (t.getKind() == TypeKind.VOID) |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
273 |
return elems.getName("void"); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
274 |
return defaultAction(t, p); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
275 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
276 |
|
26266
2d24bda701dc
8056061: Mark implementations of public interfaces with an annotation
jlahoda
parents:
25874
diff
changeset
|
277 |
@Override @DefinedBy(Api.LANGUAGE_MODEL) |
3996
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
278 |
public Name visitTypeVariable(TypeVariable t, Void p) { |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
279 |
return t.getUpperBound().accept(this, p); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
280 |
} |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
281 |
}; |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
282 |
return v.visit(type).toString(); |
dc676a9093b3
6572945: javah should be written as an annotation processor, not a doclet
jjg
parents:
1789
diff
changeset
|
283 |
} |
10 | 284 |
} |