Class LanguageJavaCodeGenerator

java.lang.Object
io.lionweb.gradleplugin.generators.AbstractJavaCodeGenerator
io.lionweb.gradleplugin.generators.LanguageJavaCodeGenerator

public class LanguageJavaCodeGenerator extends AbstractJavaCodeGenerator
The LanguageJavaCodeGenerator class is responsible for generating Java code representations of language definitions and their associated components.
  • Constructor Details

    • LanguageJavaCodeGenerator

      public LanguageJavaCodeGenerator(@Nonnull File destinationDir)
      Constructs a LanguageJavaCodeGenerator with the specified destination directory.
      Parameters:
      destinationDir - the directory where the generated code will be stored; must not be null
      Throws:
      NullPointerException - if the destinationDir is null
    • LanguageJavaCodeGenerator

      public LanguageJavaCodeGenerator(@Nonnull File destinationDir, @Nonnull Map<String,String> mappings)
      Constructs a LanguageJavaCodeGenerator with a specified destination directory.
      Parameters:
      destinationDir - the directory where the generated code will be stored; must not be null
      Throws:
      NullPointerException - if the destinationDir is null
  • Method Details

    • generate

      public void generate(@Nonnull Collection<io.lionweb.language.Language> languages, @Nullable String defaultPackageName, @Nonnull Map<String,String> specificPackages, @Nonnull Map<String,String> languageClassNames)
      Generates code for the specified languages and package name.
      Parameters:
      languages - a collection of languages for which the code will be generated; must not be null
      defaultPackageName - the base package name under which the code will be generated; must not be null
    • generate

      public void generate(@Nonnull io.lionweb.language.Language language, @Nonnull String packageName) throws IOException
      Throws:
      IOException
    • generate

      public void generate(@Nonnull Collection<io.lionweb.language.Language> languages, @Nonnull String packageName)
    • generate

      public void generate(@Nonnull io.lionweb.language.Language language, @Nonnull io.lionweb.gradleplugin.generators.GenerationContext generationContext) throws IOException
      Generates Java code files for a specified language and package name.
      Parameters:
      language - the language for which the code will be generated; must not be null
      Throws:
      IOException - if an I/O error occurs during code generation