This class models a constructor. Information about the constructor can be accessed, and the constructor can be invoked dynamically.
Public Member Functions | |
TypeVariable< Constructor< T > >[] | getTypeParameters () |
String | toGenericString () |
Type[] | getGenericParameterTypes () |
Type[] | getGenericExceptionTypes () |
Annotation[][] | getParameterAnnotations () |
boolean | isVarArgs () |
boolean | isSynthetic () |
boolean | equals (Object object) |
Compares the specified object to this Constructor and answer if they are equal. | |
Class< T > | getDeclaringClass () |
Return the Class associated with the class that defined this constructor. | |
Class<?>[] | getExceptionTypes () |
Return an array of the Class objects associated with the exceptions declared to be thrown by this constructor. | |
int | getModifiers () |
Return the modifiers for the modeled constructor. | |
String | getName () |
Return the name of the modeled constructor. | |
Class<?>[] | getParameterTypes () |
Return an array of the Class objects associated with the parameter types of this constructor. | |
int | hashCode () |
Answers an integer hash code for the receiver. | |
T | newInstance (Object...args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException |
Return a new instance of the declaring class, initialized by dynamically invoking the modeled constructor. | |
String | toString () |
Answers a string containing a concise, human-readable description of the receiver. | |
Private Member Functions | |
Constructor () | |
Prevent this class from being instantiated. |
java.lang.reflect.Constructor< T >.Constructor | ( | ) | [private] |
Prevent this class from being instantiated.
String java.lang.reflect.Constructor< T >.toGenericString | ( | ) |
Returns the String representation of the constructor's declaration, including the type parameters.
Type [] java.lang.reflect.Constructor< T >.getGenericParameterTypes | ( | ) |
Gets the parameter types as an array of Type instances, in declaration order. If the constructor has no parameters, then an empty array is returned.
GenericSignatureFormatError | if the generic method signature is invalid. | |
TypeNotPresentException | if the component type points to a missing type. | |
MalformedParameterizedTypeException | if the component type points to a type that can't be instantiated for some reason. |
Type [] java.lang.reflect.Constructor< T >.getGenericExceptionTypes | ( | ) |
Gets the exception types as an array of Type instances. If the constructor has no declared exceptions, then an empty array is returned.
GenericSignatureFormatError | if the generic method signature is invalid. | |
TypeNotPresentException | if the component type points to a missing type. | |
MalformedParameterizedTypeException | if the component type points to a type that can't be instantiated for some reason. |
Annotation [][] java.lang.reflect.Constructor< T >.getParameterAnnotations | ( | ) |
Gets an array of arrays that represent the annotations of the formal parameters of this constructor. If there are no parameters on this constructor, then an empty array is returned. If there are no annotations set, then and array of empty arrays is returned.
boolean java.lang.reflect.Constructor< T >.isVarArgs | ( | ) |
Indicates whether or not this constructor takes a variable number argument.
true
if a vararg is declare, otherwise false
. boolean java.lang.reflect.Constructor< T >.equals | ( | Object | object | ) |
Compares the specified object to this Constructor and answer if they are equal.
The object must be an instance of Constructor with the same defining class and parameter types.
object | the object to compare |
Class<T> java.lang.reflect.Constructor< T >.getDeclaringClass | ( | ) |
Return the Class associated with the class that defined this constructor.
Class<?> [] java.lang.reflect.Constructor< T >.getExceptionTypes | ( | ) |
Return an array of the Class objects associated with the exceptions declared to be thrown by this constructor.
If the constructor was not declared to throw any exceptions, the array returned will be empty.
int java.lang.reflect.Constructor< T >.getModifiers | ( | ) |
Return the modifiers for the modeled constructor.
The Modifier class should be used to decode the result.
Reimplemented from java.lang.reflect.AccessibleObject.
String java.lang.reflect.Constructor< T >.getName | ( | ) |
Return the name of the modeled constructor.
This is the name of the declaring class.
Class<?> [] java.lang.reflect.Constructor< T >.getParameterTypes | ( | ) |
Return an array of the Class objects associated with the parameter types of this constructor.
If the constructor was declared with no parameters, the array returned will be empty.
int java.lang.reflect.Constructor< T >.hashCode | ( | ) |
Answers an integer hash code for the receiver.
Objects which are equal answer the same value for this method. The hash code for a Constructor is the hash code of the declaring class' name.
T java.lang.reflect.Constructor< T >.newInstance | ( | Object... | args | ) | throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException |
Return a new instance of the declaring class, initialized by dynamically invoking the modeled constructor.
This reproduces the effect of new declaringClass(arg1, arg2, ... , argN)
This method performs the following:
args | the arguments to the constructor |
java.lang.InstantiationException | if the class cannot be instantiated | |
java.lang.IllegalAccessException | if the modeled constructor is not accessible | |
java.lang.IllegalArgumentException | if an incorrect number of arguments are passed, or an argument could not be converted by a widening conversion | |
java.lang.reflect.InvocationTargetException | if an exception was thrown by the invoked constructor |
String java.lang.reflect.Constructor< T >.toString | ( | ) |
Answers a string containing a concise, human-readable description of the receiver.
The format of the string is modifiers (if any) declaring class name '(' parameter types, separated by ',' ')' If the constructor throws exceptions, ' throws ' exception types, separated by ',' For example: public String(byte[],String) throws UnsupportedEncodingException
Genereated on Tue Dec 9 14:09:48 2008 by Doxygen.
(c) Copyright 2005, 2008 The Apache Software Foundation or its licensors, as applicable.