Class ReflectionUtil


  • public final class ReflectionUtil
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ReflectionUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      private static java.lang.RuntimeException handleInaccessibleObjectException​(java.lang.RuntimeException e)  
      static java.lang.Throwable trySetAccessible​(java.lang.reflect.AccessibleObject object, boolean checkAccessible)
      Try to call AccessibleObject.setAccessible(boolean) but will catch any SecurityException and InaccessibleObjectException and return it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReflectionUtil

        private ReflectionUtil()
    • Method Detail

      • trySetAccessible

        public static java.lang.Throwable trySetAccessible​(java.lang.reflect.AccessibleObject object,
                                                           boolean checkAccessible)
        Try to call AccessibleObject.setAccessible(boolean) but will catch any SecurityException and InaccessibleObjectException and return it. The caller must check if it returns null and if not handle the returned exception.
      • handleInaccessibleObjectException

        private static java.lang.RuntimeException handleInaccessibleObjectException​(java.lang.RuntimeException e)