I've been working with the csv-validator-java-api and came across a potential discrepancy in its documentation (or maybe I misunderstood how to use it). According to the documentation, the inner static class ValidatorBuilder can be instantiated directly using:
CsvValidator.ValidatorBuilder validateWithReaders = new CsvValidator.ValidatorBuilder(
csvReader, csvSchemaReader
);
However, upon reviewing the implementation on GitHub, it appears that ValidatorBuilder is marked as package-private. This means it cannot be accessed directly outside its package. Here is the relevant section of the code: CsvValidator.java(https://github.com/digital-preservation/csv-validator/blob/master/csv-validator-java-api/src/main/java/uk/gov/nationalarchives/csv/validator/api/java/CsvValidator.java#L198) on GitHub.
Given this contradiction, I'd appreciate any guidance on the following:
- Is there an oversight in the documentation regarding the accessibility of
ValidatorBuilderas it seems to be the right entry point for the validator creation ? - How can I correctly implement validation using csv-validator-java-api without direct access to
ValidatorBuilder, or what is the intended approach? - Should the visibility of
ValidatorBuilderbe adjusted in the implementation, or is there another way to access its functionality?
Any insights on how to resolve or workaround this issue would be greatly appreciated. Thank you!
CssValidatorclass seems to have staticvalidatemethods you can try to use. Though they're all deprecated in the latest version, presumably in favor ofValidatorBuilder. But as you've pointed out, the builder class isn't public. I would suggest opening an issue about this. I'm surprised there isn't an issue for this already.