Interface HibernateConstraintValidatorInitializationContext
-
- All Known Implementing Classes:
HibernateConstraintValidatorInitializationContextImpl
@Incubating public interface HibernateConstraintValidatorInitializationContext
Provides contextual data and operations when initializing a constraint validator.- Since:
- 6.0.5
- Author:
- Marko Bekhta
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ClockProvidergetClockProvider()Returns the provider for obtaining the current time in the form of aClock, e.g.ScriptEvaluatorgetScriptEvaluatorForLanguage(String languageName)Returns aScriptEvaluatorcreated by theScriptEvaluatorFactorypassed at bootstrap.DurationgetTemporalValidationTolerance()Returns the temporal validation tolerance i.e.
-
-
-
Method Detail
-
getScriptEvaluatorForLanguage
ScriptEvaluator getScriptEvaluatorForLanguage(String languageName)
Returns aScriptEvaluatorcreated by theScriptEvaluatorFactorypassed at bootstrap.- Parameters:
languageName- the name of the scripting language- Returns:
- a script evaluator for the given language. Never null.
- Throws:
ScriptEvaluatorNotFoundException- in case noScriptEvaluatorwas found for a givenlanguageName
-
getClockProvider
ClockProvider getClockProvider()
Returns the provider for obtaining the current time in the form of aClock, e.g. when validating theFutureandPastconstraints.- 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.
-
getTemporalValidationTolerance
@Incubating Duration getTemporalValidationTolerance()
Returns the temporal validation tolerance i.e. the acceptable margin of error when comparing date/time in temporal constraints.- Returns:
- the tolerance
- Since:
- 6.0.5
-
-