author | ksrini |
Fri, 09 Feb 2018 13:58:17 -0800 | |
changeset 48840 | 5e2d2067da48 |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
15385 | 1 |
/* |
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
2 |
* Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. |
15385 | 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 |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
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 |
* |
|
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. |
|
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; |
15385 | 27 |
|
28 |
import com.sun.javadoc.*; |
|
29 |
import com.sun.tools.javac.code.Attribute; |
|
30 |
import com.sun.tools.javac.code.Attribute.TypeCompound; |
|
31 |
import com.sun.tools.javac.util.List; |
|
32 |
||
33 |
/** |
|
34 |
* Implementation of <code>AnnotatedType</code>, which |
|
35 |
* represents an annotated type. |
|
36 |
* |
|
37 |
* @author Mahmood Ali |
|
38 |
* @since 1.8 |
|
39 |
*/ |
|
48840
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
40 |
@Deprecated(since="9", forRemoval=true) |
5e2d2067da48
8194651: javadoc: mark the com.sun.javadoc API for removal
ksrini
parents:
47216
diff
changeset
|
41 |
@SuppressWarnings("removal") |
15385 | 42 |
public class AnnotatedTypeImpl |
43 |
extends AbstractTypeImpl implements AnnotatedType { |
|
44 |
||
19906
2698aaacb4b2
8023833: Replace direct use of AnnotatedType in javadoc code
jjg
parents:
15385
diff
changeset
|
45 |
AnnotatedTypeImpl(DocEnv env, com.sun.tools.javac.code.Type type) { |
15385 | 46 |
super(env, type); |
47 |
} |
|
48 |
||
49 |
/** |
|
50 |
* Get the annotations of this program element. |
|
51 |
* Return an empty array if there are none. |
|
52 |
*/ |
|
53 |
@Override |
|
54 |
public AnnotationDesc[] annotations() { |
|
19906
2698aaacb4b2
8023833: Replace direct use of AnnotatedType in javadoc code
jjg
parents:
15385
diff
changeset
|
55 |
List<? extends TypeCompound> tas = type.getAnnotationMirrors(); |
15385 | 56 |
if (tas == null || |
57 |
tas.isEmpty()) { |
|
58 |
return new AnnotationDesc[0]; |
|
59 |
} |
|
60 |
AnnotationDesc res[] = new AnnotationDesc[tas.length()]; |
|
61 |
int i = 0; |
|
62 |
for (Attribute.Compound a : tas) { |
|
63 |
res[i++] = new AnnotationDescImpl(env, a); |
|
64 |
} |
|
65 |
return res; |
|
66 |
} |
|
67 |
||
68 |
@Override |
|
69 |
public com.sun.javadoc.Type underlyingType() { |
|
24396 | 70 |
return TypeMaker.getType(env, type, true, false); |
15385 | 71 |
} |
72 |
||
73 |
@Override |
|
74 |
public AnnotatedType asAnnotatedType() { |
|
75 |
return this; |
|
76 |
} |
|
77 |
||
78 |
@Override |
|
79 |
public String toString() { |
|
80 |
return typeName(); |
|
81 |
} |
|
82 |
||
83 |
@Override |
|
84 |
public String typeName() { |
|
85 |
return this.underlyingType().typeName(); |
|
86 |
} |
|
87 |
||
88 |
@Override |
|
89 |
public String qualifiedTypeName() { |
|
90 |
return this.underlyingType().qualifiedTypeName(); |
|
91 |
} |
|
92 |
||
93 |
@Override |
|
94 |
public String simpleTypeName() { |
|
95 |
return this.underlyingType().simpleTypeName(); |
|
96 |
} |
|
97 |
||
98 |
@Override |
|
99 |
public String dimension() { |
|
100 |
return this.underlyingType().dimension(); |
|
101 |
} |
|
102 |
||
103 |
@Override |
|
104 |
public boolean isPrimitive() { |
|
105 |
return this.underlyingType().isPrimitive(); |
|
106 |
} |
|
107 |
||
108 |
@Override |
|
109 |
public ClassDoc asClassDoc() { |
|
110 |
return this.underlyingType().asClassDoc(); |
|
111 |
} |
|
112 |
||
113 |
@Override |
|
114 |
public TypeVariable asTypeVariable() { |
|
115 |
return this.underlyingType().asTypeVariable(); |
|
116 |
} |
|
117 |
||
118 |
@Override |
|
119 |
public WildcardType asWildcardType() { |
|
120 |
return this.underlyingType().asWildcardType(); |
|
121 |
} |
|
122 |
||
123 |
@Override |
|
124 |
public ParameterizedType asParameterizedType() { |
|
125 |
return this.underlyingType().asParameterizedType(); |
|
126 |
} |
|
127 |
} |