Class ProjectValidator
java.lang.Object
com.pragma.archetype.domain.service.ProjectValidator
Domain service responsible for validating project state before
initialization.
Ensures the project is in a valid state to be initialized with clean
architecture.
-
Constructor Summary
ConstructorsConstructorDescriptionProjectValidator(FileSystemPort fileSystemPort, ConfigurationPort configurationPort) -
Method Summary
Modifier and TypeMethodDescriptionvalidateForComponentGeneration(Path projectPath) Validates that a component can be generated in the project.validateForInitialization(Path projectPath, ProjectConfig config) Validates that the project can be initialized with clean architecture.
-
Constructor Details
-
ProjectValidator
-
-
Method Details
-
validateForInitialization
Validates that the project can be initialized with clean architecture. Validation rules: 1. Project directory must exist 2. Project must not already be initialized (no .cleanarch.yml) 3. Project should be mostly empty (only build files allowed) 4. Configuration parameters must be valid- Parameters:
projectPath- the root directory of the projectconfig- the configuration to validate- Returns:
- ValidationResult with success status and any error messages
-
validateForComponentGeneration
Validates that a component can be generated in the project.- Parameters:
projectPath- the root directory of the project- Returns:
- ValidationResult with success status and any error messages
-