1 |
/* java.lang.reflect.Method - reflection of Java methods |
/* java.lang.reflect.Method - reflection of Java methods |
2 |
Copyright (C) 1998, 2001, 2002 Free Software Foundation, Inc. |
Copyright (C) 1998, 2001, 2002, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This file is part of GNU Classpath. |
This file is part of GNU Classpath. |
5 |
|
|
38 |
|
|
39 |
package java.lang.reflect; |
package java.lang.reflect; |
40 |
|
|
41 |
|
import gnu.java.lang.reflect.MethodSignatureParser; |
42 |
import java.util.Arrays; |
import java.util.Arrays; |
43 |
|
|
44 |
/** |
/** |
75 |
* @status updated to 1.4 |
* @status updated to 1.4 |
76 |
*/ |
*/ |
77 |
public final class Method |
public final class Method |
78 |
extends AccessibleObject implements Member |
extends AccessibleObject implements Member, GenericDeclaration |
79 |
{ |
{ |
80 |
Class declaringClass; |
Class declaringClass; |
81 |
String name; |
String name; |
330 |
return invokeNative(o, args, declaringClass, slot); |
return invokeNative(o, args, declaringClass, slot); |
331 |
} |
} |
332 |
|
|
|
/* |
|
|
* NATIVE HELPERS |
|
|
*/ |
|
|
|
|
333 |
private native Object invokeNative(Object o, Object[] args, |
private native Object invokeNative(Object o, Object[] args, |
334 |
Class declaringClass, int slot) |
Class declaringClass, int slot) |
335 |
throws IllegalAccessException, InvocationTargetException; |
throws IllegalAccessException, InvocationTargetException; |
336 |
|
|
337 |
|
/** |
338 |
|
* Returns an array of <code>TypeVariable</code> objects that represents |
339 |
|
* the type variables declared by this constructor, in declaration order. |
340 |
|
* An array of size zero is returned if this class has no type |
341 |
|
* variables. |
342 |
|
* |
343 |
|
* @return the type variables associated with this class. |
344 |
|
* @throws GenericSignatureFormatError if the generic signature does |
345 |
|
* not conform to the format specified in the Virtual Machine |
346 |
|
* specification, version 3. |
347 |
|
* @since 1.5 |
348 |
|
*/ |
349 |
|
public TypeVariable<?>[] getTypeParameters() |
350 |
|
{ |
351 |
|
String sig = getSignature(); |
352 |
|
MethodSignatureParser p = new MethodSignatureParser(this, sig); |
353 |
|
return p.getTypeParameters(); |
354 |
|
} |
355 |
|
|
356 |
|
private native String getSignature(); |
357 |
} |
} |