Class AspectProxyClassGenerator

java.lang.Object
org.ek9lang.compiler.backend.jvm.AspectProxyClassGenerator

final class AspectProxyClassGenerator extends Object
Generates a synthetic proxy class for aspect weaving.

The proxy extends the base type and wraps a delegate with ordered aspect instances. For each public non-operator method, the proxy generates a wrapped version with before/after advice chains following standard AOP conventions:

  • Before advice in registration order
  • Delegate call with try/finally
  • After advice in reverse registration order (even on exception)

Follows the standalone class generator pattern established by EnumIteratorClassGenerator.

  • Constructor Details

    • AspectProxyClassGenerator

      AspectProxyClassGenerator(File outputRootDirectory)
      Create a proxy class generator.
      Parameters:
      outputRootDirectory - Root output directory for class files (where root-level classes go)
  • Method Details

    • generate

      String generate(AspectProxyInstr instr)
      Generate the proxy class for the given aspect proxy instruction.
      Parameters:
      instr - The CREATE_ASPECT_PROXY instruction with all details
      Returns:
      The JVM internal name of the generated proxy class