@Incubating public interface HibernateConstraintValidator<A extends Annotation,T> extends ConstraintValidator<A,T>
ConstraintValidator
contract.Modifier and Type | Method and Description |
---|---|
default void |
initialize(ConstraintDescriptor<A> constraintDescriptor,
HibernateConstraintValidatorInitializationContext initializationContext)
Initializes the validator in preparation for
ConstraintValidator.isValid(Object, ConstraintValidatorContext) calls. |
initialize, isValid
default void initialize(ConstraintDescriptor<A> constraintDescriptor, HibernateConstraintValidatorInitializationContext initializationContext)
ConstraintValidator.isValid(Object, ConstraintValidatorContext)
calls.
It is an alternative to ConstraintValidator.initialize(Annotation)
method. Should be used if any additional information
except annotation is needed to initialize a validator.
Note, when using HibernateConstraintValidator
user should only override one of the methods, either
initialize(ConstraintDescriptor, HibernateConstraintValidatorInitializationContext)
or ConstraintValidator.initialize(Annotation)
.
Both methods will be called during initialization, starting with
initialize(ConstraintDescriptor, HibernateConstraintValidatorInitializationContext)
.constraintDescriptor
- a constraint descriptor for a given constraint declarationinitializationContext
- an initialization context for a current ConstraintValidatorFactory
Copyright © 2021 JBoss by Red Hat. All rights reserved.