Interface ClassDefiner

All Known Implementing Classes:
FallbackClassDefiner, LookupClassDefiner
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@Internal @FunctionalInterface public interface ClassDefiner
Internal utility class to define classes in the runtime.
Since:
4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    defineClass(@NonNull String name, @NonNull Class<?> parent, byte[] bytecode)
    Defines the given class bytecode and return the constructed class object.
  • Method Details

    • defineClass

      @NonNull @NonNull Class<?> defineClass(@NonNull @NonNull String name, @NonNull @NonNull Class<?> parent, byte[] bytecode)
      Defines the given class bytecode and return the constructed class object.
      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.
      Throws:
      IllegalStateException - if the class defining failed.
      NullPointerException - if name or parent is null.