Top Description Methods
org.hibernate.validator.constraintvalidation

public Interface HibernateConstraintValidatorInitializationContext

Known Direct Implementers
org.hibernate.validator.internal.engine.constraintvalidation.HibernateConstraintValidatorInitializationContextImpl
Annotations
@Incubating
Imports
java.time.Clock, .Duration, jakarta.validation.ClockProvider, org.hibernate.validator.Incubating, org.hibernate.validator.spi.scripting.ScriptEvaluator, .ScriptEvaluatorFactory, .ScriptEvaluatorNotFoundException

Provides contextual data and operations when initializing a constraint validator.
Author
Marko Bekhta
Since
6.0.5

Method Summary

Modifier and TypeMethod and Description
public ClockProvider

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 by Clock#systemDefaultZone() will be returned.
getClockProvider
()

Returns the provider for obtaining the current time in the form of a Clock, e.g. when validating the Future and Past constraints.

public ScriptEvaluator

Returns:

a script evaluator for the given language. Never null.
getScriptEvaluatorForLanguage
(String
the name of the scripting language
languageName
)

Returns a ScriptEvaluator created by the ScriptEvaluatorFactory passed at bootstrap.

public Duration

Returns:

the tolerance
getTemporalValidationTolerance
()

Returns the temporal validation tolerance i.e. the acceptable margin of error when comparing date/time in temporal constraints.

Method Detail

getClockProviderback to summary
public ClockProvider getClockProvider()

Returns the provider for obtaining the current time in the form of a Clock, e.g. when validating the Future and Past constraints.

Returns:ClockProvider

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 by Clock#systemDefaultZone() will be returned.

getScriptEvaluatorForLanguageback to summary
public ScriptEvaluator getScriptEvaluatorForLanguage(String languageName)

Returns a ScriptEvaluator created by the ScriptEvaluatorFactory passed at bootstrap.

Parameters
languageName:String

the name of the scripting language

Returns:ScriptEvaluator

a script evaluator for the given language. Never null.

Exceptions
ScriptEvaluatorNotFoundException:
in case no ScriptEvaluator was found for a given languageName
getTemporalValidationToleranceback to summary
public Duration getTemporalValidationTolerance()

Returns the temporal validation tolerance i.e. the acceptable margin of error when comparing date/time in temporal constraints.

Returns:Duration

the tolerance

Annotations
@Incubating
Since
6.0.5