232 /** |
232 /** |
233 * Returns an array of {@code Class} objects that represent the formal |
233 * Returns an array of {@code Class} objects that represent the formal |
234 * parameter types, in declaration order, of the executable |
234 * parameter types, in declaration order, of the executable |
235 * represented by this object. Returns an array of length |
235 * represented by this object. Returns an array of length |
236 * 0 if the underlying executable takes no parameters. |
236 * 0 if the underlying executable takes no parameters. |
|
237 * Note that the constructors of some inner classes |
|
238 * may have an implicitly declared parameter in addition to |
|
239 * explicitly declared ones. |
237 * |
240 * |
238 * @return the parameter types for the executable this object |
241 * @return the parameter types for the executable this object |
239 * represents |
242 * represents |
240 */ |
243 */ |
241 public abstract Class<?>[] getParameterTypes(); |
244 public abstract Class<?>[] getParameterTypes(); |
255 /** |
258 /** |
256 * Returns an array of {@code Type} objects that represent the formal |
259 * Returns an array of {@code Type} objects that represent the formal |
257 * parameter types, in declaration order, of the executable represented by |
260 * parameter types, in declaration order, of the executable represented by |
258 * this object. Returns an array of length 0 if the |
261 * this object. Returns an array of length 0 if the |
259 * underlying executable takes no parameters. |
262 * underlying executable takes no parameters. |
|
263 * Note that the constructors of some inner classes |
|
264 * may have an implicitly declared parameter in addition to |
|
265 * explicitly declared ones. |
260 * |
266 * |
261 * <p>If a formal parameter type is a parameterized type, |
267 * <p>If a formal parameter type is a parameterized type, |
262 * the {@code Type} object returned for it must accurately reflect |
268 * the {@code Type} object returned for it must accurately reflect |
263 * the actual type parameters used in the source code. |
269 * the actual type arguments used in the source code. |
264 * |
270 * |
265 * <p>If a formal parameter type is a type variable or a parameterized |
271 * <p>If a formal parameter type is a type variable or a parameterized |
266 * type, it is created. Otherwise, it is resolved. |
272 * type, it is created. Otherwise, it is resolved. |
267 * |
273 * |
268 * @return an array of {@code Type}s that represent the formal |
274 * @return an array of {@code Type}s that represent the formal |
671 * anonymous class, then the return value is null. |
677 * anonymous class, then the return value is null. |
672 * |
678 * |
673 * @return an object representing the receiver type of the method or |
679 * @return an object representing the receiver type of the method or |
674 * constructor represented by this {@code Executable} or {@code null} if |
680 * constructor represented by this {@code Executable} or {@code null} if |
675 * this {@code Executable} can not have a receiver parameter |
681 * this {@code Executable} can not have a receiver parameter |
|
682 * |
|
683 * @jls 8.4 Method Declarations |
|
684 * @jls 8.4.1 Formal Parameters |
|
685 * @jls 8.8 Constructor Declarations |
676 */ |
686 */ |
677 public AnnotatedType getAnnotatedReceiverType() { |
687 public AnnotatedType getAnnotatedReceiverType() { |
678 if (Modifier.isStatic(this.getModifiers())) |
688 if (Modifier.isStatic(this.getModifiers())) |
679 return null; |
689 return null; |
680 return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(), |
690 return TypeAnnotationParser.buildAnnotatedType(getTypeAnnotationBytes0(), |
693 * corresponds to the order of the formal parameter types in the |
703 * corresponds to the order of the formal parameter types in the |
694 * declaration of the method/constructor. |
704 * declaration of the method/constructor. |
695 * |
705 * |
696 * Returns an array of length 0 if the method/constructor declares no |
706 * Returns an array of length 0 if the method/constructor declares no |
697 * parameters. |
707 * parameters. |
|
708 * Note that the constructors of some inner classes |
|
709 * may have an implicitly declared parameter in addition to |
|
710 * explicitly declared ones. |
698 * |
711 * |
699 * @return an array of objects representing the types of the |
712 * @return an array of objects representing the types of the |
700 * formal parameters of the method or constructor represented by this |
713 * formal parameters of the method or constructor represented by this |
701 * {@code Executable} |
714 * {@code Executable} |
702 */ |
715 */ |