Class InjectedClassRuntime.Lookup

  • Enclosing class:
    InjectedClassRuntime

    private static class InjectedClassRuntime.Lookup
    extends java.lang.Object
    Provides access to classes java.lang.invoke.MethodHandles and java.lang.invoke.MethodHandles.Lookup introduced in Java 8.
    • Field Detail

      • instance

        private final java.lang.Object instance
    • Constructor Detail

      • Lookup

        private Lookup​(java.lang.Object instance)
    • Method Detail

      • lookup

        static InjectedClassRuntime.Lookup lookup()
                                           throws java.lang.Exception
        Returns:
        a lookup object for the caller of this method
        Throws:
        java.lang.Exception
      • privateLookupIn

        static InjectedClassRuntime.Lookup privateLookupIn​(java.lang.Class<?> targetClass,
                                                           InjectedClassRuntime.Lookup lookup)
                                                    throws java.lang.Exception
        See corresponding method introduced in Java 9.
        Parameters:
        targetClass - the target class
        lookup - the caller lookup object
        Returns:
        a lookup object for the target class, with private access
        Throws:
        java.lang.Exception
      • defineClass

        java.lang.Class<?> defineClass​(byte[] bytes)
                                throws java.lang.Exception
        See corresponding method introduced in Java 9.
        Parameters:
        bytes - the class bytes
        Returns:
        class
        Throws:
        java.lang.Exception