public Constructor<T> getDeclaredConstructor(Class<?>... parameterTypes) throws NoSuchMethodException, SecurityException
返回一个构造函数对象,该对象反映这个类对象所表示的类或接口的指定构造函数。参数类型是一个类对象的数组,该数组标识构造函数的正式参数类型,即声明的顺序。如果这个类对象表示在非静态上下文中声明的内部类,那么正式的参数类型包括显式的封闭实例作为第一个参数。
Parameters:
parameterTypes
- 参数列表的类型数值
Returns:
返回具有<指定参数列表>构造函数的构造函数对象
Throws:
NoSuchMethodException
- 未找到对应的构造方法
SecurityException
- 如果声明安全管理 s, 且满足下列情况:
1)s.checkMemberAccess(this, Member.DECLARED)
拒绝访问已声明的方法
2)the caller's class loader is not the same as or an ancestor of the class loader for the current class and invocation of s.checkPackageAccess()
denies access to the package of this class(调用者的类加载器和当前类类的类加载器的ancestor不同:有道翻译)