Package mekhq.utilities
Class SystemValidator
java.lang.Object
mekhq.utilities.SystemValidator
Validates planetary system YAML data files for structural correctness and data integrity.
This validator deserializes each YAML file using the same Jackson pipeline as production code, then checks for
required fields, valid ranges, duplicate IDs, and data consistency. It can be run as a standalone Gradle task
(./gradlew validateSystems) or called programmatically from unit tests.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new validator, initializing the YAML deserializer and loading known faction codes. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidEntry point for the GradlevalidateSystemstask.Validates all planetary system data files found under the given directory path.
-
Constructor Details
-
SystemValidator
public SystemValidator()Creates a new validator, initializing the YAML deserializer and loading known faction codes.
-
-
Method Details
-
validate
Validates all planetary system data files found under the given directory path.Recursively scans for
.ymlfiles and.ziparchives containing YAML entries. Each file is deserialized and checked for structural correctness and data integrity.- Parameters:
dataPath- the path to the directory containing planetary system data files- Returns:
- a
ValidationResultcontaining all findings and summary statistics
-
main
Entry point for the GradlevalidateSystemstask. Validates all system data files in the specified directory (or the default path) and exits with code 1 if any errors are found.- Parameters:
args- optional: path to data directory (defaults toMHQConstants.PLANETARY_SYSTEM_DIRECTORY_PATH)
-