206 * @since 1.8 |
206 * @since 1.8 |
207 */ |
207 */ |
208 public com.sun.javadoc.Type receiverType() { |
208 public com.sun.javadoc.Type receiverType() { |
209 Type recvtype = sym.type.asMethodType().recvtype; |
209 Type recvtype = sym.type.asMethodType().recvtype; |
210 return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null; |
210 return (recvtype != null) ? TypeMaker.getType(env, recvtype, false, true) : null; |
211 } |
|
212 |
|
213 public AnnotationDesc[] receiverAnnotations() { |
|
214 // TODO: change how receiver annotations are output! |
|
215 Type recvtype = sym.type.asMethodType().recvtype; |
|
216 if (recvtype == null) { |
|
217 return new AnnotationDesc[0]; |
|
218 } |
|
219 if (!recvtype.isAnnotated()) { |
|
220 return new AnnotationDesc[0]; |
|
221 } |
|
222 List<? extends Compound> typeAnnos = ((com.sun.tools.javac.code.Type.AnnotatedType)recvtype).typeAnnotations; |
|
223 AnnotationDesc result[] = new AnnotationDesc[typeAnnos.length()]; |
|
224 int i = 0; |
|
225 for (Attribute.Compound a : typeAnnos) { |
|
226 result[i++] = new AnnotationDescImpl(env, a); |
|
227 } |
|
228 return result; |
|
229 } |
211 } |
230 |
212 |
231 /** |
213 /** |
232 * Return the formal type parameters of this method or constructor. |
214 * Return the formal type parameters of this method or constructor. |
233 * Return an empty array if there are none. |
215 * Return an empty array if there are none. |