1

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 ValidatorBuilder as 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 ValidatorBuilder be 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!

3
  • 1
    The CssValidator class seems to have static validate methods you can try to use. Though they're all deprecated in the latest version, presumably in favor of ValidatorBuilder. 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. Commented Oct 27 at 16:22
  • 1
    I wonder if most people use this project as a tool (command line or GUI) more than as a library. Or if they use it in Scala projects more than Java projects. Either might explain why seemingly no one has come across this problem before. Commented Oct 27 at 16:33
  • @Slaw the last commit was 3 weeks ago so I guess it is still maintained. Now, maybe you are right : it is not meant to be as a lib but in that case it is a little bit disappointing as I am sure many people would have been interested in that. I will open an issue. Thanks Commented Oct 28 at 10:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.