public class Constructors
extends java.lang.Object
| Constructor and Description |
|---|
Constructors() |
| Modifier and Type | Method and Description |
|---|---|
static <T> java.lang.reflect.Constructor<T> |
getDeclaredConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
Get a declared constructor of a class by its parameter types
|
static <T> java.lang.reflect.Constructor<T>[] |
getDeclaredConstructors(java.lang.Class<T> clazz)
Get all declared constructors of a class
|
static <T> T |
invoke(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
Invoke a constructor without any checks
|
public static <T> java.lang.reflect.Constructor<T>[] getDeclaredConstructors(java.lang.Class<T> clazz)
clazz - The class to get the constructors ofpublic static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
clazz - The class to get the constructor ofparameterTypes - The parameter types of the constructorpublic static <T> T invoke(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
constructor - The constructor to invokeargs - The arguments to pass to the constructor