public final class Constructors extends Object
class constructors
.Modifier and Type | Method | Description |
---|---|---|
static <T> Constructor<T> |
findConstructor(Class<T> type,
Class<?>... parameterTypes) |
|
static Constructor<?> |
findConstructor(String className) |
|
static Constructor<?> |
findConstructor(String className,
Class<?>... parameterTypes) |
|
static Constructor<?> |
findConstructor(String className,
String... parameterTypeNames) |
|
static <T> Constructor<T> |
getConstructor(Class<T> type,
Class<?>... parameterTypes) |
|
static Constructor<?> |
getConstructor(String className) |
|
static Constructor<?> |
getConstructor(String className,
Class<?>... parameterTypes) |
|
static Constructor<?> |
getConstructor(String className,
String... parameterTypeNames) |
public static <T> Constructor<T> getConstructor(Class<T> type, Class<?>... parameterTypes)
T
- The type of object created by the returned constructor.type
- The class to obtain the constructor for.parameterTypes
- The parameter types the constructor needs to be called with.MethodInvocationException
- If no suitable constructor could be found corresponding to the parameter types.public static Constructor<?> getConstructor(String className, Class<?>... parameterTypes)
public static Constructor<?> getConstructor(String className, String... parameterTypeNames)
public static Constructor<?> getConstructor(String className)
public static <T> Constructor<T> findConstructor(Class<T> type, Class<?>... parameterTypes)
public static Constructor<?> findConstructor(String className, Class<?>... parameterTypes)
public static Constructor<?> findConstructor(String className, String... parameterTypeNames)
public static Constructor<?> findConstructor(String className)
Copyright © 2016–2020 Talsma ICT. All rights reserved.