My question is a branch of of this one.
I have a Annotation (say phone annotation) that I want to validate. I can use @phone validator to check if a phone object is valid or not. I want to also be able to place this validator on a contact information object that contains a phone. Is there a way to use multiple validators for one annotation so I can use @phone for my phone object and my contact information object?
Would something like
@Constraint(validatedBy = {PhoneIsValid.class, PhoneIsValid2.class})
work? (The idea being one Validator handles the phone object and the other handles the contact information object.)