Class ReflectionUtils


  • public final class ReflectionUtils
    extends Object
    Author:
    snowgoose
    • Constructor Detail

      • ReflectionUtils

        public ReflectionUtils()
    • Method Detail

      • getMethodParameterAnnotation

        public static <T extends Annotation> T getMethodParameterAnnotation​(Method method,
                                                                            Class<T> annotationClass,
                                                                            int parameterIndex)
      • getInstanceQuietly

        public static <T> T getInstanceQuietly​(Class<T> clazz)
      • getInstanceQuietly

        public static <T> T getInstanceQuietly​(Class<T> type,
                                               Constructor<?> constructor,
                                               Object... args)
      • filterClassAsImplementsInterface

        public static <T> List<Class<T>> filterClassAsImplementsInterface​(Class<T> filteringType,
                                                                          Collection<Class<?>> collectedClasses)
      • getMethods

        public static Method[] getMethods​(Class<?> clazz)
      • writeValueToField

        public static void writeValueToField​(Field field,
                                             Object instance,
                                             Object value)
      • writeValueToField

        public static void writeValueToField​(String fieldName,
                                             Object instance,
                                             Object value)
      • getAccessibleField

        public static Field getAccessibleField​(Class<?> targetClass,
                                               String fieldName)
      • setAccessible

        public static void setAccessible​(Field field)
      • getValueOfField

        public static Object getValueOfField​(String fieldName,
                                             int modifier,
                                             Object instance)
      • getMethodQuietly

        public static Method getMethodQuietly​(Class<?> clazz,
                                              String methodName,
                                              Class<?>[] parameterTypes)
      • nop

        public void nop()
      • findAllImplementsInterfacesRecursivery

        public static Set<Class<?>> findAllImplementsInterfacesRecursivery​(Class<?> find)
      • getCallerClasses

        public static List<Class<?>> getCallerClasses()
      • getCallerClasses

        public static List<Class<?>> getCallerClasses​(Thread thread)