public class ValidatorContextImpl extends java.lang.Object implements HibernateValidatorContext
| Constructor and Description |
|---|
ValidatorContextImpl(ValidatorFactoryImpl validatorFactory) |
| Modifier and Type | Method and Description |
|---|---|
HibernateValidatorContext |
addValueExtractor(javax.validation.valueextraction.ValueExtractor<?> extractor) |
HibernateValidatorContext |
allowMultipleCascadedValidationOnReturnValues(boolean allow)
Define whether more than one constraint on a return value may be marked for cascading validation are allowed.
|
HibernateValidatorContext |
allowOverridingMethodAlterParameterConstraint(boolean allow)
Define whether overriding methods that override constraints should throw a
ConstraintDefinitionException. |
HibernateValidatorContext |
allowParallelMethodsDefineParameterConstraints(boolean allow)
Define whether parallel methods that define constraints should throw a
ConstraintDefinitionException. |
HibernateValidatorContext |
clockProvider(javax.validation.ClockProvider clockProvider) |
HibernateValidatorContext |
constraintValidatorFactory(javax.validation.ConstraintValidatorFactory factory) |
HibernateValidatorContext |
constraintValidatorPayload(java.lang.Object dynamicPayload)
Define a payload passed to the constraint validators.
|
HibernateValidatorContext |
enableTraversableResolverResultCache(boolean enabled)
Define whether the per validation call caching of
TraversableResolver results is enabled. |
HibernateValidatorContext |
failFast(boolean failFast)
En- or disables the fail fast mode.
|
javax.validation.Validator |
getValidator() |
HibernateValidatorContext |
messageInterpolator(javax.validation.MessageInterpolator messageInterpolator) |
HibernateValidatorContext |
parameterNameProvider(javax.validation.ParameterNameProvider parameterNameProvider) |
HibernateValidatorContext |
temporalValidationTolerance(java.time.Duration temporalValidationTolerance)
Define the temporal validation tolerance i.e.
|
HibernateValidatorContext |
traversableResolver(javax.validation.TraversableResolver traversableResolver) |
public ValidatorContextImpl(ValidatorFactoryImpl validatorFactory)
public HibernateValidatorContext messageInterpolator(javax.validation.MessageInterpolator messageInterpolator)
messageInterpolator in interface javax.validation.ValidatorContextmessageInterpolator in interface HibernateValidatorContextpublic HibernateValidatorContext traversableResolver(javax.validation.TraversableResolver traversableResolver)
traversableResolver in interface javax.validation.ValidatorContexttraversableResolver in interface HibernateValidatorContextpublic HibernateValidatorContext constraintValidatorFactory(javax.validation.ConstraintValidatorFactory factory)
constraintValidatorFactory in interface javax.validation.ValidatorContextconstraintValidatorFactory in interface HibernateValidatorContextpublic HibernateValidatorContext parameterNameProvider(javax.validation.ParameterNameProvider parameterNameProvider)
parameterNameProvider in interface javax.validation.ValidatorContextparameterNameProvider in interface HibernateValidatorContextpublic HibernateValidatorContext clockProvider(javax.validation.ClockProvider clockProvider)
clockProvider in interface javax.validation.ValidatorContextclockProvider in interface HibernateValidatorContextpublic HibernateValidatorContext addValueExtractor(javax.validation.valueextraction.ValueExtractor<?> extractor)
addValueExtractor in interface javax.validation.ValidatorContextaddValueExtractor in interface HibernateValidatorContextpublic HibernateValidatorContext failFast(boolean failFast)
HibernateValidatorContextfailFast in interface HibernateValidatorContextfailFast - true to enable fail fast, false otherwise.this following the chaining method patternpublic HibernateValidatorContext allowOverridingMethodAlterParameterConstraint(boolean allow)
HibernateValidatorContextConstraintDefinitionException.
The default value is false, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"In sub types (be it sub classes/interfaces or interface implementations), no parameter constraints may be declared on overridden or implemented methods, nor may parameters be marked for cascaded validation. This would pose a strengthening of preconditions to be fulfilled by the caller."
allowOverridingMethodAlterParameterConstraint in interface HibernateValidatorContextallow - flag determining whether validation will allow overriding to alter parameter constraints.this following the chaining method patternpublic HibernateValidatorContext allowMultipleCascadedValidationOnReturnValues(boolean allow)
HibernateValidatorContextfalse, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"One must not mark a method return value for cascaded validation more than once in a line of a class hierarchy. In other words, overriding methods on sub types (be it sub classes/interfaces or interface implementations) cannot mark the return value for cascaded validation if the return value has already been marked on the overridden method of the super type or interface."
allowMultipleCascadedValidationOnReturnValues in interface HibernateValidatorContextallow - flag determining whether validation will allow multiple cascaded validation on return values.this following the chaining method patternpublic HibernateValidatorContext allowParallelMethodsDefineParameterConstraints(boolean allow)
HibernateValidatorContextConstraintDefinitionException. The
default value is false, i.e. do not allow.
See Section 4.5.5 of the JSR 380 specification, specifically
"If a sub type overrides/implements a method originally defined in several parallel types of the hierarchy (e.g. two interfaces not extending each other, or a class and an interface not implemented by said class), no parameter constraints may be declared for that method at all nor parameters be marked for cascaded validation. This again is to avoid an unexpected strengthening of preconditions to be fulfilled by the caller."
allowParallelMethodsDefineParameterConstraints in interface HibernateValidatorContextallow - flag determining whether validation will allow parameter constraints in parallel hierarchiesthis following the chaining method patternpublic HibernateValidatorContext enableTraversableResolverResultCache(boolean enabled)
HibernateValidatorContextTraversableResolver results is enabled. The default
value is true, i.e. the caching is enabled.
This behavior was initially introduced to cache the JPATraversableResolver results but the map lookups it
introduces can be counterproductive when the TraversableResolver calls are very fast.
enableTraversableResolverResultCache in interface HibernateValidatorContextenabled - flag determining whether per validation call caching is enabled for TraversableResolver
results.this following the chaining method patternpublic HibernateValidatorContext temporalValidationTolerance(java.time.Duration temporalValidationTolerance)
HibernateValidatorContexttemporalValidationTolerance in interface HibernateValidatorContexttemporalValidationTolerance - the tolerancethis following the chaining method patternpublic HibernateValidatorContext constraintValidatorPayload(java.lang.Object dynamicPayload)
HibernateValidatorContextconstraintValidatorPayload in interface HibernateValidatorContextdynamicPayload - the payload passed to constraint validatorsthis following the chaining method patternpublic javax.validation.Validator getValidator()
getValidator in interface javax.validation.ValidatorContextCopyright © 2007-2022 Red Hat, Inc. All Rights Reserved