Class ReflectionHack


  • public class ReflectionHack
    extends java.lang.Object
    Allow private access to fields across using a JVM version-appropriate strategy without having a compile-time dependency on Java 9+. This entire class can be replaced by a direct call to JDK 9+ MethodHandles.privateLookupIn once Jackson targets Java >= 9.
    • Constructor Summary

      Constructors 
      Constructor Description
      ReflectionHack()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.invoke.MethodHandles.Lookup privateLookupIn​(java.lang.Class<?> lookup, java.lang.invoke.MethodHandles.Lookup orig)  
      • Methods inherited from class java.lang.Object

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

      • ReflectionHack

        public ReflectionHack()
    • Method Detail

      • privateLookupIn

        public static java.lang.invoke.MethodHandles.Lookup privateLookupIn​(java.lang.Class<?> lookup,
                                                                            java.lang.invoke.MethodHandles.Lookup orig)
                                                                     throws java.lang.IllegalAccessException
        Throws:
        java.lang.IllegalAccessException