List of usage examples for java.lang.reflect Constructor isVarArgs
@Override public boolean isVarArgs()
From source file:Main.java
public static void main(String[] argv) throws Exception { Constructor[] constructors = ArrayList.class.getDeclaredConstructors(); for (int i = 0; i < constructors.length; i++) { Constructor c = constructors[i]; System.out.println(c.isVarArgs()); }//from w w w . j av a2 s . com }
From source file:Main.java
public static void main(String... args) throws Exception { Class<?> c = Class.forName(args[0]); Constructor[] allConstructors = c.getDeclaredConstructors(); for (Constructor ctor : allConstructors) { int searchMod = modifierFromString(args[1]); int mods = accessModifiers(ctor.getModifiers()); if (searchMod == mods) { out.format("%s%n", ctor.toGenericString()); out.format(" [ synthetic=%-5b var_args=%-5b ]%n", ctor.isSynthetic(), ctor.isVarArgs()); }/* ww w.j a va2s .com*/ } }
From source file:ConstructorAccess.java
public static void main(String... args) { try {/*from w ww . j a va 2 s . com*/ Class<?> c = Class.forName(args[0]); Constructor[] allConstructors = c.getDeclaredConstructors(); for (Constructor ctor : allConstructors) { int searchMod = modifierFromString(args[1]); int mods = accessModifiers(ctor.getModifiers()); if (searchMod == mods) { out.format("%s%n", ctor.toGenericString()); out.format(" [ synthetic=%-5b var_args=%-5b ]%n", ctor.isSynthetic(), ctor.isVarArgs()); } } // production code should handle this exception more gracefully } catch (ClassNotFoundException x) { x.printStackTrace(); } }