Package com.devonfw.cobigen.cli.utils
Class ValidationUtils
- java.lang.Object
-
- com.devonfw.cobigen.cli.utils.ValidationUtils
-
public final class ValidationUtils extends java.lang.ObjectUtilities class for validating user's input and generation
-
-
Constructor Summary
Constructors Constructor Description ValidationUtils()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidcheckGenerationReport(com.devonfw.cobigen.api.to.GenerationReportTo report)Checks the generation report in order to find possible errors and warningsstatic booleanisOutputRootPathValid(java.io.File outputRootPath)Checks whether the current output root path is valid.static voidprintNoTriggersMatched(java.io.File inputFile, boolean isJavaInput, boolean isOpenApiInput)Prints an error message to the user informing that no triggers have been matched.booleanvalidateFile(java.io.File inputFile)Validating user input file is correct or not.
-
-
-
Method Detail
-
validateFile
public boolean validateFile(java.io.File inputFile)
Validating user input file is correct or not. We check if file exists and it can be read- Parameters:
inputFile- user input file- Returns:
- true when file is valid
-
isOutputRootPathValid
public static boolean isOutputRootPathValid(java.io.File outputRootPath)
Checks whether the current output root path is valid. It can be either null because it is an optional parameter or either a folder that exists.- Parameters:
outputRootPath- where the user wants to generate the code- Returns:
- true if it is a valid output root path
-
checkGenerationReport
public static void checkGenerationReport(com.devonfw.cobigen.api.to.GenerationReportTo report)
Checks the generation report in order to find possible errors and warnings- Parameters:
report- the generation report returned by the CobiGen.generate method
-
printNoTriggersMatched
public static void printNoTriggersMatched(java.io.File inputFile, boolean isJavaInput, boolean isOpenApiInput)Prints an error message to the user informing that no triggers have been matched. Depending on the type of the input file will print different messages.- Parameters:
inputFile- User input fileisJavaInput- true when input file is JavaisOpenApiInput- true when input file is OpenAPI
-
-