/** Returns an array of {@link Constructor} containing the public constructors of the class represented by the supplied Class. */ static public Constructor[] getConstructors (Class c) { java.lang.reflect.Constructor[] constructors = c.getConstructors(); Constructor[] result = new Constructor[constructors.length]; for (int i = 0, j = constructors.length; i < j; i++) { result[i] = new Constructor(constructors[i]); } return result; }
/** Returns an array of {@link Constructor} containing the public constructors of the class represented by the supplied Class. */ static public Constructor[] getConstructors (Class c) { java.lang.reflect.Constructor[] constructors = c.getConstructors(); Constructor[] result = new Constructor[constructors.length]; for (int i = 0, j = constructors.length; i < j; i++) { result[i] = new Constructor(constructors[i]); } return result; }
/** Returns a {@link Constructor} that represents the constructor for the supplied class which takes the supplied parameter * types. */ static public Constructor getDeclaredConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getDeclaredConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation while getting constructor for class: " + c.getName(), e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }
/** Returns a {@link Constructor} that represents the public constructor for the supplied class which takes the supplied * parameter types. */ static public Constructor getConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation occurred while getting constructor for class: '" + c.getName() + "'.", e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }
/** Returns a {@link Constructor} that represents the public constructor for the supplied class which takes the supplied * parameter types. */ static public Constructor getConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation occurred while getting constructor for class: '" + c.getName() + "'.", e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }
/** Returns a {@link Constructor} that represents the constructor for the supplied class which takes the supplied parameter * types. */ static public Constructor getDeclaredConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getDeclaredConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation while getting constructor for class: " + c.getName(), e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }
/** Returns an array of {@link Constructor} containing the public constructors of the class represented by the supplied Class. */ static public Constructor[] getConstructors (Class c) { java.lang.reflect.Constructor[] constructors = c.getConstructors(); Constructor[] result = new Constructor[constructors.length]; for (int i = 0, j = constructors.length; i < j; i++) { result[i] = new Constructor(constructors[i]); } return result; }
/** Returns a {@link Constructor} that represents the constructor for the supplied class which takes the supplied parameter * types. */ static public Constructor getDeclaredConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getDeclaredConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation while getting constructor for class: " + c.getName(), e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }
/** Returns a {@link Constructor} that represents the public constructor for the supplied class which takes the supplied * parameter types. */ static public Constructor getConstructor (Class c, Class... parameterTypes) throws ReflectionException { try { return new Constructor(c.getConstructor(parameterTypes)); } catch (SecurityException e) { throw new ReflectionException("Security violation occurred while getting constructor for class: '" + c.getName() + "'.", e); } catch (NoSuchMethodException e) { throw new ReflectionException("Constructor not found for class: " + c.getName(), e); } }