Class ApplicationClassGenerator

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

public final class ApplicationClassGenerator extends Object
Generates a single global _Application JVM class from application registrations.

This is a dumb static struct — no methods, no <clinit>. Just public static fields where each field stores a registered component or service. Field name is the mangled FQN of the registered-as type.

The _Application class is a global singleton at the root level (no module prefix). Only one program runs per runtime, so there is exactly one _Application class. Injection sites can access it via GETSTATIC without knowing which application or module populated the fields.

This is the JVM-specific backend for application code generation, called by CodeGenerationApplications. LLVM backend would have its own equivalent.

  • Constructor Details

    • ApplicationClassGenerator

      public ApplicationClassGenerator(FileHandling fileHandling)
  • Method Details

    • generate

      public void generate(List<AggregateSymbol> applications, File outputDirectory)
      Generate the global _Application.class file. Only one program runs per runtime, so this is a root-level singleton.
      Parameters:
      applications - all application symbols across all modules
      outputDirectory - the base output directory for generated class files