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)
T - The type of the classclazz - The class to get the constructors from@Nullable
public static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor(java.lang.Class<T> clazz,
java.lang.Class<?>... parameterTypes)
T - The type of the classclazz - The class to get the constructor fromparameterTypes - The parameter types of the constructorpublic static <T> T invoke(java.lang.reflect.Constructor<T> constructor,
java.lang.Object... args)
T - The type of the classconstructor - The constructor to invokeargs - The arguments to pass to the constructor