/[classpath]/classpath/vm/reference/java/lang/reflect/Constructor.java
ViewVC logotype

Diff of /classpath/vm/reference/java/lang/reflect/Constructor.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.11 by egagnon, Mon Mar 29 07:07:40 2004 UTC revision 1.11.2.1 by tromey, Fri Aug 27 00:05:03 2004 UTC
# Line 1  Line 1 
1  /* java.lang.reflect.Constructor - reflection of Java constructors  /* java.lang.reflect.Constructor - reflection of Java constructors
2     Copyright (C) 1998, 2001 Free Software Foundation, Inc.     Copyright (C) 1998, 2001, 2004 Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 73  import java.util.Arrays; Line 73  import java.util.Arrays;
73   * @since 1.1   * @since 1.1
74   * @status updated to 1.4   * @status updated to 1.4
75   */   */
76  public final class Constructor  public final class Constructor<T>
77  extends AccessibleObject implements Member    extends AccessibleObject
78      implements GenericDeclaration, Member
79  {  {
80    private Class clazz;    private Class<T> clazz;
81    private int slot;    private int slot;
82    private Class[] parameterTypes;    private Class[] parameterTypes;
83    private Class[] exceptionTypes;    private Class[] exceptionTypes;
# Line 98  extends AccessibleObject implements Memb Line 99  extends AccessibleObject implements Memb
99     * Gets the class that declared this constructor.     * Gets the class that declared this constructor.
100     * @return the class that declared this member     * @return the class that declared this member
101     */     */
102    public Class getDeclaringClass()    public Class<T> getDeclaringClass()
103    {    {
104      return clazz;      return clazz;
105    }    }
# Line 129  extends AccessibleObject implements Memb Line 130  extends AccessibleObject implements Memb
130     *     *
131     * @return a list of the types of the constructor's parameters     * @return a list of the types of the constructor's parameters
132     */     */
133    public Class[] getParameterTypes()    public Class<?>[] getParameterTypes()
134    {    {
135      if (parameterTypes == null)      if (parameterTypes == null)
136        return new Class[0];        return new Class[0];
# Line 143  extends AccessibleObject implements Memb Line 144  extends AccessibleObject implements Memb
144     *     *
145     * @return a list of the types in the constructor's throws clause     * @return a list of the types in the constructor's throws clause
146     */     */
147    public Class[] getExceptionTypes()    public Class<?>[] getExceptionTypes()
148    {    {
149      if (exceptionTypes == null)      if (exceptionTypes == null)
150        return new Class[0];        return new Class[0];
# Line 247  extends AccessibleObject implements Memb Line 248  extends AccessibleObject implements Memb
248     * @throws ExceptionInInitializerError if construction triggered class     * @throws ExceptionInInitializerError if construction triggered class
249     *         initialization, which then failed     *         initialization, which then failed
250     */     */
251    public Object newInstance(Object args[])    public T newInstance(Object args[])
252      throws InstantiationException, IllegalAccessException,      throws InstantiationException, IllegalAccessException,
253             InvocationTargetException             InvocationTargetException
254    {    {
255      return constructNative(args, clazz, slot);      return constructNative(args, clazz, slot);
256    }    }
257    
258    private native Object constructNative(Object[] args, Class declaringClass,    private native T constructNative(Object[] args, Class declaringClass,
259                                          int slot)                                     int slot)
260      throws InstantiationException, IllegalAccessException,      throws InstantiationException, IllegalAccessException,
261             InvocationTargetException;             InvocationTargetException;
262  }  }

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.11.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26