uniVocity / univocity-parsers

uniVocity-parsers is a suite of extremely fast and reliable parsers for Java. It provides a consistent interface for handling different file formats, and a solid framework for the development of new parsers.
905 stars 249 forks source link

Get bean attribute name from Validate Anottation #456

Open jesusvillalbam opened 3 years ago

jesusvillalbam commented 3 years ago

I want to validate a lot of fields to be mandatory, and i using validate anottation to do this:

public class MandatoryValidator implements Validator<String> {
    @Override
    public String validate(String value) {
        if(!value.matches(REGEX_STRING_DOES_NOT_CONTAIN_ONLY_ZEROS)){
            System.out.println("Is mandatory"); // Will be persist in DB
        }
        return null;
    }
}

How can i get the bean attibute name to be identified?

PD: I was trying with RetryableErrorHandler but keepRecord() is not working for me i don´t know what i am doing wrong.