Class LanguageJavaCodeGenerator
java.lang.Object
io.lionweb.gradleplugin.generators.AbstractJavaCodeGenerator
io.lionweb.gradleplugin.generators.LanguageJavaCodeGenerator
The LanguageJavaCodeGenerator class is responsible for generating Java code representations of
language definitions and their associated components.
-
Field Summary
Fields inherited from class io.lionweb.gradleplugin.generators.AbstractJavaCodeGenerator
destinationDir, JAVA_KEYWORDS, mappings -
Constructor Summary
ConstructorsConstructorDescriptionLanguageJavaCodeGenerator(File destinationDir) Constructs a LanguageJavaCodeGenerator with the specified destination directory.LanguageJavaCodeGenerator(File destinationDir, Map<String, String> mappings) Constructs a LanguageJavaCodeGenerator with a specified destination directory. -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate(io.lionweb.language.Language language, io.lionweb.gradleplugin.generators.GenerationContext generationContext) Generates Java code files for a specified language and package name.voidvoidgenerate(Collection<io.lionweb.language.Language> languages, String packageName) voidgenerate(Collection<io.lionweb.language.Language> languages, String defaultPackageName, Map<String, String> specificPackages, Map<String, String> languageClassNames) Generates code for the specified languages and package name.Methods inherited from class io.lionweb.gradleplugin.generators.AbstractJavaCodeGenerator
getterName, toVariableName
-
Constructor Details
-
LanguageJavaCodeGenerator
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 nulldefaultPackageName- 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
-