Class FallbackClassDefiner

java.lang.Object
eu.cloudnetservice.driver.util.define.FallbackClassDefiner
All Implemented Interfaces:
ClassDefiner

@Internal final class FallbackClassDefiner extends Object implements ClassDefiner
A class definer which defines classes using a class loader. This is a fallback method which will not work as expected on modern jvm implementations which have higher access check requirements. In normal cases this definer should never get used as the LookupClassDefiner should define classes.
Since:
4.0
  • Field Details

  • Constructor Details

    • FallbackClassDefiner

      FallbackClassDefiner()
  • Method Details

    • defineClass

      @NonNull public @NonNull Class<?> defineClass(@NonNull @NonNull String name, @NonNull @NonNull Class<?> parent, byte[] bytecode)
      Defines the given class bytecode and return the constructed class object.
      Specified by:
      defineClass in interface ClassDefiner
      Parameters:
      name - the name of the class to construct.
      parent - the parent class of this class as we are assuming to define an anonymous class.
      bytecode - the bytecode of the class to define.
      Returns:
      the constructed class object from the given bytecode.