Class AnonymousClassDefiner

  • All Implemented Interfaces:
    ClassDefiner

    final class AnonymousClassDefiner
    extends java.lang.Object
    implements ClassDefiner
    ClassDefiner that defines classes using sun.misc.Unsafe#defineAnonymousClass.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.lang.reflect.Method ANONYMOUS_DEFINE_METHOD  
      private static java.lang.Object THE_UNSAFE  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Class<?> define​(java.lang.Class<?> hostClass, byte[] bytecode)
      Defines a new class relative to the host.
      • Methods inherited from class java.lang.Object

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

      • THE_UNSAFE

        private static final java.lang.Object THE_UNSAFE
      • ANONYMOUS_DEFINE_METHOD

        private static final java.lang.reflect.Method ANONYMOUS_DEFINE_METHOD
    • Constructor Detail

      • AnonymousClassDefiner

        AnonymousClassDefiner()
    • Method Detail

      • define

        public java.lang.Class<?> define​(java.lang.Class<?> hostClass,
                                         byte[] bytecode)
                                  throws java.lang.Exception
        Description copied from interface: ClassDefiner
        Defines a new class relative to the host.
        Specified by:
        define in interface ClassDefiner
        Throws:
        java.lang.Exception