Package jakarta.validation
Interface ConstraintValidatorFactory
-
public interface ConstraintValidatorFactory
Instantiates aConstraintValidator
instance based off its class. TheConstraintValidatorFactory
is not responsible for callingConstraintValidator.initialize(java.lang.annotation.Annotation)
.- Author:
- Dhanji R. Prasanna, Emmanuel Bernard, Hardy Ferentschik
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends ConstraintValidator<?,?>>
TgetInstance(Class<T> key)
void
releaseInstance(ConstraintValidator<?,?> instance)
SignalsConstraintValidatorFactory
that the instance is no longer being used by the Jakarta Bean Validation provider.
-
-
-
Method Detail
-
getInstance
<T extends ConstraintValidator<?,?>> T getInstance(Class<T> key)
- Type Parameters:
T
- The type of the constraint validator to instantiate- Parameters:
key
- The class of the constraint validator to instantiate- Returns:
- A new constraint validator instance of the specified class
-
releaseInstance
void releaseInstance(ConstraintValidator<?,?> instance)
SignalsConstraintValidatorFactory
that the instance is no longer being used by the Jakarta Bean Validation provider.- Parameters:
instance
- validator being released- Since:
- 1.1
-
-