Class ReflectionHelper


  • public final class ReflectionHelper
    extends Object
    A utility/helper class for working with Classes and Reflection.
    • Field Detail

      • EMPTY_CLASS_ARRAY

        @Deprecated
        public static final Class[] EMPTY_CLASS_ARRAY
        Deprecated.
        in 2.0. Will become private in a future version.
    • Method Detail

      • getConstructor

        public static <T> Constructor<T> getConstructor​(Class<T> instantiable,
                                                        Class<?>... constructorParameterTypes)
      • parameterTypesMatch

        public static boolean parameterTypesMatch​(Class<?>[] candidateParamTypes,
                                                  Class<?>... desiredParameterTypes)
      • newInstance

        public static <T> T newInstance​(Constructor<T> constructor,
                                        Object... constructorArguments)
      • newInstance

        public static <T> T newInstance​(Class<T> aClass)
        This method may return null if the call to create a newInstance() fails.
      • hasDefaultConstructor

        public static boolean hasDefaultConstructor​(Class<?> aClass)