org.apache.commons.jocl

Class ConstructorUtil

public class ConstructorUtil extends Object

Miscellaneous {@link Constructor} related utility functions.

Version: $Revision: 1.6 $ $Date: 2004/02/28 12:18:18 $

Author: Rodney Waldhoff

Method Summary
static ConstructorgetConstructor(Class type, Class[] argTypes)
Returns a {@link Constructor} for the given method signature, or null if no such Constructor can be found.
static ObjectinvokeConstructor(Class type, Class[] argTypes, Object[] argValues)
Creates a new instance of the specified type using a {@link Constructor} described by the given parameter types and values.

Method Detail

getConstructor

public static Constructor getConstructor(Class type, Class[] argTypes)
Returns a {@link Constructor} for the given method signature, or null if no such Constructor can be found.

Parameters: type the (non-null) type of {@link Object} the returned {@link Constructor} should create argTypes a non-null array of types describing the parameters to the {@link Constructor}.

Returns: a {@link Constructor} for the given method signature, or null if no such Constructor can be found.

See Also: ConstructorUtil

invokeConstructor

public static Object invokeConstructor(Class type, Class[] argTypes, Object[] argValues)
Creates a new instance of the specified type using a {@link Constructor} described by the given parameter types and values.

Parameters: type the type of {@link Object} to be created argTypes a non-null array of types describing the parameters to the {@link Constructor}. argValues a non-null array containing the values of the parameters to the {@link Constructor}.

Returns: a new instance of the specified type using a {@link Constructor} described by the given parameter types and values.

Throws: InstantiationException IllegalAccessException InvocationTargetException

Copyright © 2001-2003 Apache Software Foundation. Documenation generated September 20 2007.