类 ConstructorUtils


  • public abstract class ConstructorUtils
    extends BaseUtils
    The utilities class of Constructor
    从以下版本开始:
    1.0.0
    作者:
    Mercy
    • 字段概要

      字段 
      修饰符和类型 字段 说明
      static java.lang.reflect.Constructor NOT_FOUND_CONSTRUCTOR  
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static <T> java.lang.reflect.Constructor<T> findConstructor​(java.lang.Class<T> type, java.lang.Class<?>... parameterTypes)  
      static java.util.List<java.lang.reflect.Constructor<?>> findConstructors​(java.lang.Class<?> type, java.util.function.Predicate<? super java.lang.reflect.Constructor<?>>... constructorFilters)  
      static java.util.List<java.lang.reflect.Constructor<?>> findDeclaredConstructors​(java.lang.Class<?> type, java.util.function.Predicate<? super java.lang.reflect.Constructor<?>>... constructorFilters)  
      static <T> java.lang.reflect.Constructor<T> getConstructor​(java.lang.Class<T> type, java.lang.Class<?>... parameterTypes)  
      static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor​(java.lang.Class<T> type, java.lang.Class<?>... parameterTypes)  
      static boolean hasNonPrivateConstructorWithoutParameters​(java.lang.Class<?> type)  
      static boolean isNonPrivateConstructorWithoutParameters​(java.lang.reflect.Constructor<?> constructor)
      Is a non-private constructor without parameters
      static <T> T newInstance​(java.lang.reflect.Constructor<T> constructor, java.lang.Object... args)
      Create an instance by the specified Constructor and arguments
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 字段详细资料

      • NOT_FOUND_CONSTRUCTOR

        public static final java.lang.reflect.Constructor NOT_FOUND_CONSTRUCTOR
    • 构造器详细资料

      • ConstructorUtils

        public ConstructorUtils()
    • 方法详细资料

      • isNonPrivateConstructorWithoutParameters

        public static boolean isNonPrivateConstructorWithoutParameters​(java.lang.reflect.Constructor<?> constructor)
        Is a non-private constructor without parameters
        参数:
        constructor - Constructor
        返回:
        true if the given Constructor is a public no-arg one, otherwise false
      • hasNonPrivateConstructorWithoutParameters

        public static boolean hasNonPrivateConstructorWithoutParameters​(java.lang.Class<?> type)
      • findConstructors

        public static java.util.List<java.lang.reflect.Constructor<?>> findConstructors​(java.lang.Class<?> type,
                                                                                        java.util.function.Predicate<? super java.lang.reflect.Constructor<?>>... constructorFilters)
      • findDeclaredConstructors

        public static java.util.List<java.lang.reflect.Constructor<?>> findDeclaredConstructors​(java.lang.Class<?> type,
                                                                                                java.util.function.Predicate<? super java.lang.reflect.Constructor<?>>... constructorFilters)
      • getConstructor

        public static <T> java.lang.reflect.Constructor<T> getConstructor​(java.lang.Class<T> type,
                                                                          java.lang.Class<?>... parameterTypes)
      • getDeclaredConstructor

        public static <T> java.lang.reflect.Constructor<T> getDeclaredConstructor​(java.lang.Class<T> type,
                                                                                  java.lang.Class<?>... parameterTypes)
      • findConstructor

        public static <T> java.lang.reflect.Constructor<T> findConstructor​(java.lang.Class<T> type,
                                                                           java.lang.Class<?>... parameterTypes)
      • newInstance

        public static <T> T newInstance​(java.lang.reflect.Constructor<T> constructor,
                                        java.lang.Object... args)
        Create an instance by the specified Constructor and arguments
        类型参数:
        T - the type of instance
        参数:
        constructor - Constructor
        args - the Constructors arguments
        返回:
        non-null