Interface ConstraintValidatorContext
- All Superinterfaces:
jakarta.validation.ConstraintValidatorContext
- All Known Implementing Classes:
DefaultConstraintValidatorContext
public interface ConstraintValidatorContext
extends jakarta.validation.ConstraintValidatorContext
Subset of the
ConstraintValidatorContext interface without the unnecessary parts.- Since:
- 1.2
- Author:
- graemerocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.validation.ConstraintValidatorContext
jakarta.validation.ConstraintValidatorContext.ConstraintViolationBuilder -
Method Summary
Modifier and TypeMethodDescription@NonNull jakarta.validation.ClockProviderReturns the provider for obtaining the current time in the form of aClock, e.g.@Nullable ObjectIn case of using this constraint validator withjakarta.validation.ConstraintValidatorreturns null, because JRS-303 doesn't support passing a root bean in their validation context.default voidmessageTemplate(@Nullable String messageTemplate) Sets a message template to be used for the validation error message.Methods inherited from interface jakarta.validation.ConstraintValidatorContext
buildConstraintViolationWithTemplate, disableDefaultConstraintViolation, getDefaultConstraintMessageTemplate, unwrap
-
Method Details
-
getClockProvider
@NonNull @NonNull jakarta.validation.ClockProvider getClockProvider()Returns the provider for obtaining the current time in the form of aClock, e.g. when validating theFutureandPastconstraints.- Specified by:
getClockProviderin interfacejakarta.validation.ConstraintValidatorContext- Returns:
- the provider for obtaining the current time, never
null. If no specific provider has been configured during bootstrap, a default implementation using the current system time and the current default time zone as returned byClock.systemDefaultZone()will be returned. - Since:
- 2.0
-
getRootBean
In case of using this constraint validator withjakarta.validation.ConstraintValidatorreturns null, because JRS-303 doesn't support passing a root bean in their validation context.- Returns:
- The root bean under validation.
-
messageTemplate
Sets a message template to be used for the validation error message.- Parameters:
messageTemplate- the message template- Since:
- 2.5.0
-