author | jjg |
Fri, 27 May 2016 13:06:58 -0700 | |
changeset 38617 | d93a7f64e231 |
parent 37938 | 42baa89d2156 |
permissions | -rw-r--r-- |
10 | 1 |
/* |
15385 | 2 |
* Copyright (c) 2001, 2013, 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 |
||
37938
42baa89d2156
8075703: jdk.javadoc module exports com.sun.tools.javadoc package which contains a lot of internal API.
jjg
parents:
25874
diff
changeset
|
26 |
package com.sun.tools.javadoc.main; |
10 | 27 |
|
28 |
import com.sun.javadoc.*; |
|
29 |
||
14260
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
30 |
/** |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
31 |
* <p><b>This is NOT part of any supported API. |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
32 |
* 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:
14258
diff
changeset
|
33 |
* This code and its internal interfaces are subject to change or |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
34 |
* deletion without notice.</b> |
727a84636f12
8000665: fix "internal API" comments on javadoc files
jjg
parents:
14258
diff
changeset
|
35 |
*/ |
38617 | 36 |
@Deprecated |
10 | 37 |
class PrimitiveType implements com.sun.javadoc.Type { |
38 |
||
39 |
private final String name; |
|
40 |
||
41 |
static final PrimitiveType voidType = new PrimitiveType("void"); |
|
42 |
static final PrimitiveType booleanType = new PrimitiveType("boolean"); |
|
43 |
static final PrimitiveType byteType = new PrimitiveType("byte"); |
|
44 |
static final PrimitiveType charType = new PrimitiveType("char"); |
|
45 |
static final PrimitiveType shortType = new PrimitiveType("short"); |
|
46 |
static final PrimitiveType intType = new PrimitiveType("int"); |
|
47 |
static final PrimitiveType longType = new PrimitiveType("long"); |
|
48 |
static final PrimitiveType floatType = new PrimitiveType("float"); |
|
49 |
static final PrimitiveType doubleType = new PrimitiveType("double"); |
|
50 |
||
51 |
// error type, should never actually be used |
|
52 |
static final PrimitiveType errorType = new PrimitiveType(""); |
|
53 |
||
54 |
PrimitiveType(String name) { |
|
55 |
this.name = name; |
|
56 |
} |
|
57 |
||
58 |
/** |
|
59 |
* Return unqualified name of type excluding any dimension information. |
|
60 |
* <p> |
|
61 |
* For example, a two dimensional array of String returns 'String'. |
|
62 |
*/ |
|
63 |
public String typeName() { |
|
64 |
return name; |
|
65 |
} |
|
66 |
||
16969
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
67 |
public com.sun.javadoc.Type getElementType() { |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
68 |
return null; |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
69 |
} |
b58d8a70d921
8009686: Generated javadoc documentation should be able to display type annotation on an array
bpatel
parents:
15385
diff
changeset
|
70 |
|
10 | 71 |
/** |
72 |
* Return qualified name of type excluding any dimension information. |
|
73 |
*<p> |
|
74 |
* For example, a two dimensional array of String |
|
75 |
* returns 'java.lang.String'. |
|
76 |
*/ |
|
77 |
public String qualifiedTypeName() { |
|
78 |
return name; |
|
79 |
} |
|
80 |
||
81 |
/** |
|
82 |
* Return the simple name of this type. |
|
83 |
*/ |
|
84 |
public String simpleTypeName() { |
|
85 |
return name; |
|
86 |
} |
|
87 |
||
88 |
/** |
|
89 |
* Return the type's dimension information, as a string. |
|
90 |
* <p> |
|
91 |
* For example, a two dimensional array of String returns '[][]'. |
|
92 |
*/ |
|
93 |
public String dimension() { |
|
94 |
return ""; |
|
95 |
} |
|
96 |
||
97 |
/** |
|
98 |
* Return this type as a class. Array dimensions are ignored. |
|
99 |
* |
|
100 |
* @return a ClassDocImpl if the type is a Class. |
|
101 |
* Return null if it is a primitive type.. |
|
102 |
*/ |
|
103 |
public ClassDoc asClassDoc() { |
|
104 |
return null; |
|
105 |
} |
|
106 |
||
107 |
/** |
|
108 |
* Return null, as this is not an annotation type. |
|
109 |
*/ |
|
110 |
public AnnotationTypeDoc asAnnotationTypeDoc() { |
|
111 |
return null; |
|
112 |
} |
|
113 |
||
114 |
/** |
|
115 |
* Return null, as this is not an instantiation. |
|
116 |
*/ |
|
117 |
public ParameterizedType asParameterizedType() { |
|
118 |
return null; |
|
119 |
} |
|
120 |
||
121 |
/** |
|
122 |
* Return null, as this is not a type variable. |
|
123 |
*/ |
|
124 |
public TypeVariable asTypeVariable() { |
|
125 |
return null; |
|
126 |
} |
|
127 |
||
128 |
/** |
|
15385 | 129 |
* Return null, as this is not a wildcard type. |
10 | 130 |
*/ |
131 |
public WildcardType asWildcardType() { |
|
132 |
return null; |
|
133 |
} |
|
134 |
||
135 |
/** |
|
15385 | 136 |
* Return null, as this is not an annotated type. |
137 |
*/ |
|
138 |
public AnnotatedType asAnnotatedType() { |
|
139 |
return null; |
|
140 |
} |
|
141 |
||
142 |
/** |
|
10 | 143 |
* Returns a string representation of the type. |
144 |
* |
|
145 |
* Return name of type including any dimension information. |
|
146 |
* <p> |
|
147 |
* For example, a two dimensional array of String returns |
|
148 |
* <code>String[][]</code>. |
|
149 |
* |
|
150 |
* @return name of type including any dimension information. |
|
151 |
*/ |
|
152 |
public String toString() { |
|
153 |
return qualifiedTypeName(); |
|
154 |
} |
|
155 |
||
156 |
/** |
|
157 |
* Return true if this is a primitive type. |
|
158 |
*/ |
|
159 |
public boolean isPrimitive() { |
|
160 |
return true; |
|
161 |
} |
|
162 |
} |