Package org.apache.commons.jocl
Class ConstructorUtil
- java.lang.Object
-
- org.apache.commons.jocl.ConstructorUtil
-
public class ConstructorUtil extends java.lang.ObjectMiscellaneousConstructorrelated utility functions.- Version:
- $Revision: 479137 $ $Date: 2006-11-25 10:51:48 -0500 (Sat, 25 Nov 2006) $
- Author:
- Rodney Waldhoff
-
-
Constructor Summary
Constructors Constructor Description ConstructorUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.reflect.ConstructorgetConstructor(java.lang.Class type, java.lang.Class[] argTypes)Returns aConstructorfor the given method signature, or null if no such Constructor can be found.static java.lang.ObjectinvokeConstructor(java.lang.Class type, java.lang.Class[] argTypes, java.lang.Object[] argValues)Creates a new instance of the specified type using aConstructordescribed by the given parameter types and values.
-
-
-
Method Detail
-
getConstructor
public static java.lang.reflect.Constructor getConstructor(java.lang.Class type, java.lang.Class[] argTypes)Returns aConstructorfor the given method signature, or null if no such Constructor can be found.- Parameters:
type- the (non-null) type ofObjectthe returnedConstructorshould createargTypes- a non-null array of types describing the parameters to theConstructor.- Returns:
- a
Constructorfor the given method signature, or null if no such Constructor can be found. - See Also:
invokeConstructor(java.lang.Class, java.lang.Class[], java.lang.Object[])
-
invokeConstructor
public static java.lang.Object invokeConstructor(java.lang.Class type, java.lang.Class[] argTypes, java.lang.Object[] argValues) throws java.lang.InstantiationException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetExceptionCreates a new instance of the specified type using aConstructordescribed by the given parameter types and values.- Parameters:
type- the type ofObjectto be createdargTypes- a non-null array of types describing the parameters to theConstructor.argValues- a non-null array containing the values of the parameters to theConstructor.- Returns:
- a new instance of the specified type
using a
Constructordescribed by the given parameter types and values. - Throws:
java.lang.InstantiationExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetException
-
-