Class AbstractJavaCodeGenerator

java.lang.Object
io.lionweb.gradleplugin.generators.AbstractJavaCodeGenerator
Direct Known Subclasses:
LanguageJavaCodeGenerator, NodeClassesJavaCodeGenerator

public abstract class AbstractJavaCodeGenerator extends Object
Represents an abstract generator for Java code. This class provides foundational utilities for creating Java source files, managing destination directories, and ensuring proper naming conventions to avoid conflicts with reserved Java keywords.
  • Field Details

    • destinationDir

      @Nonnull protected final File destinationDir
    • mappings

      @NotNull protected final @NotNull Map<String,String> mappings
    • JAVA_KEYWORDS

      protected static final List<String> JAVA_KEYWORDS
  • Constructor Details

    • AbstractJavaCodeGenerator

      protected AbstractJavaCodeGenerator(@Nonnull File destinationDir, @NotNull @NotNull Map<String,String> mappings)
      Constructs an AbstractJavaCodeGenerator with a specified destination directory.
      Parameters:
      destinationDir - the directory where the generated code will be stored; must not be null
      mappings - a mapping of custom type names to their corresponding Java types; must not be null
      Throws:
      NullPointerException - if the destinationDir is null
  • Method Details

    • toVariableName

      protected String toVariableName(String name)
    • getterName

      protected static String getterName(String name)