Class FallbackClassDefiner.DefiningClassLoader

java.lang.Object
java.lang.ClassLoader
eu.cloudnetservice.driver.util.define.FallbackClassDefiner.DefiningClassLoader
Enclosing class:
FallbackClassDefiner

private static final class FallbackClassDefiner.DefiningClassLoader extends ClassLoader
A class loader which gives access to the normally protected defineClass method.
Since:
4.0
  • Constructor Details

    • DefiningClassLoader

      public DefiningClassLoader(@Nullable @Nullable ClassLoader parent)
      Creates a new defining class loader for the parent class loader of the holding class.
      Parameters:
      parent - the parent class loader for delegation.
  • Method Details

    • defineClass

      @NonNull public @NonNull Class<?> defineClass(byte[] byteCode)
      An exposed method which allows converting the given bytecode into an instance of class delegating the call to ClassLoader.defineClass(String, byte[], int, int).
      Parameters:
      byteCode - the bytecode of the class to define.
      Returns:
      the constructed class object from the given bytecode.