Class CodeGeneratorUtil

java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.CodeGeneratorUtil

public class CodeGeneratorUtil extends Object
Class used to get a class directly from code generated by a runtime code generator. The code generator extends this base class, and must implement the getClassData method. Most of this is independent of BCEL, but finalizeMethod is specific to the BCEL framework.
  • Method Details

    • makeClass

      public static Class<?> makeClass(String name, byte[] def, Class<?> anchorClass)
      Defines a class in the same classloader as a specified "anchor" class
      Parameters:
      name - the name of the class to define
      def - the byte-code definition of the new class
      anchorClass - an existing class in the desired classloader
      Returns:
      a newly created class