List of usage examples for java.lang.reflect Constructor getTypeParameters
@Override @SuppressWarnings({ "rawtypes", "unchecked" }) public TypeVariable<Constructor<T>>[] getTypeParameters()
From source file:Main.java
public static void print_method_or_constructor(Member member) { Constructor c = (Constructor) member; TypeVariable[] parameters = c.getTypeParameters(); for (int i = 0; i < parameters.length; i++) { System.out.println(parameters[i]); }//from w w w . j a va2 s . com }
From source file:io.konik.utils.RandomInvoiceGenerator.java
private static Constructor<?> findBiggestConstructor(Class<?> root) { Constructor<?>[] constructors = root.getConstructors(); Constructor<?> biggestConstructor = null; for (Constructor<?> constructor : constructors) { if (biggestConstructor == null) { biggestConstructor = constructor; continue; }/*from w w w . j a v a 2 s.c om*/ if (constructor.getTypeParameters().length > biggestConstructor.getParameterTypes().length) { biggestConstructor = constructor; } } return biggestConstructor; }