Interface ConstraintValidatorContext
-
public interface ConstraintValidatorContext
Subset of theConstraintValidatorContext
interface without the unnecessary parts.- Since:
- 1.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description javax.validation.ClockProvider
getClockProvider()
Returns the provider for obtaining the current time in the form of aClock
, e.g.java.lang.Object
getRootBean()
In case of using this constraint validator withjavax.validation.ConstraintValidator
returns null, because JRS-303 doesn't support passing a root bean in their validation context.default void
messageTemplate(java.lang.String messageTemplate)
Sets a message template to be used for the validation error message.
-
-
-
Method Detail
-
getClockProvider
@NonNull javax.validation.ClockProvider getClockProvider()
Returns the provider for obtaining the current time in the form of aClock
, e.g. when validating theFuture
andPast
constraints.- 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
@Nullable java.lang.Object getRootBean()
In case of using this constraint validator withjavax.validation.ConstraintValidator
returns null, because JRS-303 doesn't support passing a root bean in their validation context.- Returns:
- The root bean under validation.
-
messageTemplate
default void messageTemplate(@Nullable java.lang.String messageTemplate)
Sets a message template to be used for the validation error message.- Parameters:
messageTemplate
- the message template- Since:
- 2.5.0
-
-