Logo Search packages:      
Sourcecode: jamvm version File versions

java::lang::reflect::Constructor Class Reference

List of all members.

Detailed Description

The Constructor class represents a constructor of a class. It also allows dynamic creation of an object, via reflection. Invocation on Constructor objects knows how to do widening conversions, but throws IllegalArgumentException if a narrowing conversion would be necessary. You can query for information on this Constructor regardless of location, but construction access may be limited by Java language access controls. If you can't do it in the compiler, you can't normally do it here either.

Note: This class returns and accepts types as Classes, even primitive types; there are Class types defined that represent each different primitive type. They are java.lang.Boolean.TYPE, java.lang.Byte.TYPE,, also available as boolean.class, byte.class, etc. These are not to be confused with the classes java.lang.Boolean, java.lang.Byte, etc., which are real classes.

Also note that this is not a serializable class. It is entirely feasible to make it serializable using the Externalizable interface, but this is on Sun, not me.

John Keiser

Eric Blake <ebb9@email.byu.edu>

Robert Lougher

See also:






1.1 updated to 1.4

Definition at line 81 of file Constructor.java.

Public Member Functions

boolean equals (Object o)
Class getDeclaringClass ()
Class[] getExceptionTypes ()
int getModifiers ()
String getName ()
Class[] getParameterTypes ()
int hashCode ()
Object newInstance (Object args[]) throws InstantiationException, IllegalAccessException, InvocationTargetException
String toString ()

Private Member Functions

native Object constructNative (Object[] args, Class declaringClass, Class[] parameterTypes, int slot) throws InstantiationException, IllegalAccessException, InvocationTargetException
 Constructor (Class declaringClass, Class[] parameterTypes, Class[] exceptionTypes, int slot)
native int getConstructorModifiers (int slot)

Private Attributes

Class clazz
Class[] exceptionTypes
Class[] parameterTypes
int slot

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index