How claeis/ilivalidator works
Project type and purpose
• This is a Java-based open-source validation tool (“ilivalidator”) for checking INTERLIS 1+2 transfer files (XTF, ITF).
• It provides both a CLI (java -jar ilivalidator.jar) and a Swing-based GUI, supports plugins (see demoplugin), and can be built into a native image.
File structure
• Top-level build and config:
• build.gradle, settings.gradle, Gradle wrapper (gradle/, gradlew, gradlew.bat)
• .travis.yml for CI
• Core code under src/org/interlis2/validator: validation engine, tools (CheckRepoDataTool, CreateIliDataTool, UpdateIliDataTool), Validator.java, ErrorTracker, Version.properties.
• GUI under src/org/interlis2/validator/gui: Swing frames/dialogs, resource bundles (.properties).
• Plugin example under demoplugin/src/org/interlis2/validator/demo: demonstrates IOx plugin loading.
• Native-image configuration under resources/META-INF/native-image.
• Tests under test/src/org/interlis2/validator and test data under test/data.
README for additional insights
• Confirms it’s a Java CLI/GUI tool.
• Build via Gradle, binary distribution via gradle bindist.
• Documentation in docs/ilivalidator.rst.
• No external servers; runs locally on files.
Main components and their interactions
a. User interface layer
• CLI launcher (Main.java)
• GUI launcher (MainFrame.java, dialogs)
b. Core validation engine
• Parser for ITF/XTF files
• Validation rules manager (enable/disable checks, custom messages)
• ErrorTracker collects and formats results
c. Tool modules
• Repository data checker (CheckRepoDataTool)
• Data creation tool (CreateIliDataTool)
• Data update tool (UpdateIliDataTool)
d. Plugin subsystem
• Plugin loader reads from classpath (e.g., demoplugin)
• Plugins implement extension points for custom validation
e. Configuration and resources
• Native-image config for GraalVM build
• I18n message bundles
f. Test harness
• Unit tests run via Gradle
• Test data files for various scenarios
Architectural patterns and design principles
• Modular separation of core engine, UI, and tools.
• MVC pattern in GUI (view in Swing classes, controller invoking core).
• Plugin pattern for extensibility.
• Gradle build scripts for dependency and lifecycle management.
• Resource-driven configuration (INI files, .properties).
Putting it all together
• Above it, show two entry points: CLI Launcher and GUI Launcher, both pointing into the engine.
• Below the engine, position Tool Modules as separate blocks invoking the core.