Package com.devonfw.cobigen.cli.commands
Class GenerateCommand
- java.lang.Object
-
- com.devonfw.cobigen.cli.commands.GenerateCommand
-
-
Constructor Summary
Constructors Constructor Description GenerateCommand()Constructor needed for Picocli
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanareArgumentsValid()Validates the user arguments in the context of the generate command.Integercall()voidgenerate(File inputFile, File inputProject, List<? extends com.devonfw.cobigen.api.to.GenerableArtifact> finalTos, com.devonfw.cobigen.api.CobiGen cg, List<Class<?>> utilClasses, Class<?> c)Generates new templates or increments using the inputFile from the inputProject.static StringgetUserInput()Asks the user for input and returns the value
-
-
-
Method Detail
-
areArgumentsValid
public Boolean areArgumentsValid()
Validates the user arguments in the context of the generate command. Tries to check whether all the input files and the output root path are valid.- Returns:
- true when these arguments are correct
-
generate
public void generate(File inputFile, File inputProject, List<? extends com.devonfw.cobigen.api.to.GenerableArtifact> finalTos, com.devonfw.cobigen.api.CobiGen cg, List<Class<?>> utilClasses, Class<?> c)
Generates new templates or increments using the inputFile from the inputProject.- Parameters:
inputFile- input file the user wants to generate code frominputProject- input project where the input file is located. We need this in order to build the classpath of the input filefinalTos- the list of increments or templates that the user is going to use for generationcg- Initialized CobiGen instancec- class type, specifies whether Templates or Increments should be preprocessedutilClasses- util classes loaded from the templates jar
-
getUserInput
public static String getUserInput()
Asks the user for input and returns the value- Returns:
- String containing the user input
-
-