* @since 1.1
* @status updated to 1.4
*/
-public final class Constructor
+public final class Constructor<T>
extends AccessibleObject
implements GenericDeclaration, Member
{
- private Class clazz;
+ private Class<T> clazz;
private int slot;
private static final int CONSTRUCTOR_MODIFIERS
* Gets the class that declared this constructor.
* @return the class that declared this member
*/
- public Class getDeclaringClass()
+ public Class<T> getDeclaringClass()
{
return clazz;
}
*
* @return a list of the types of the constructor's parameters
*/
- public native Class[] getParameterTypes();
+ public native Class<?>[] getParameterTypes();
/**
* Get the exception types this constructor says it throws, in no particular
*
* @return a list of the types in the constructor's throws clause
*/
- public native Class[] getExceptionTypes();
+ public native Class<?>[] getExceptionTypes();
/**
* Compare two objects to see if they are semantically equivalent.
return sb.toString();
}
- /* FIXME[GENERICS]: Add X extends GenericDeclaration and TypeVariable<X> */
- static void addTypeParameters(StringBuilder sb, TypeVariable[] typeArgs)
+ static <X extends GenericDeclaration>
+ void addTypeParameters(StringBuilder sb, TypeVariable<X>[] typeArgs)
{
if (typeArgs.length == 0)
return;
* @throws ExceptionInInitializerError if construction triggered class
* initialization, which then failed
*/
- public Object newInstance(Object args[])
+ public T newInstance(Object... args)
throws InstantiationException, IllegalAccessException,
InvocationTargetException
{
return constructNative(args, clazz, slot);
}
- private native Object constructNative(Object[] args, Class declaringClass,
- int slot)
+ private native T constructNative(Object[] args, Class declaringClass,
+ int slot)
throws InstantiationException, IllegalAccessException,
InvocationTargetException;
* specification, version 3.
* @since 1.5
*/
- /* FIXME[GENERICS]: Add <Constructor<T>> */
- public TypeVariable[] getTypeParameters()
+ public TypeVariable<Constructor<T>>[] getTypeParameters()
{
String sig = getSignature();
if (sig == null)
return p.getGenericParameterTypes();
}
}
-