Class ValidatorFactoryImpl
java.lang.Object
org.hibernate.validator.internal.engine.ValidatorFactoryImpl
- All Implemented Interfaces:
ValidatorFactory,AutoCloseable,HibernateValidatorFactory
Factory returning initialized
Validator instances. This is the Hibernate Validator default
implementation of the ValidatorFactory interface.- Author:
- Emmanuel Bernard, Hardy Ferentschik, Gunnar Morling, Kevin Pollet <kevin.pollet@serli.com> (C) 2011 SERLI, Chris Beckey <cbeckey@paypal.com>, Guillaume Smet, Marko Bekhta
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes theValidatorFactoryinstance.Returns theClockProviderinstance configured at initialization time for theValidatorFactory.Returns theConstraintValidatorFactoryinstance configured at initialization time for theValidatorFactory.Returns the getter property selection strategy defining the rules determining if a method is a getter or not.Returns theMessageInterpolatorinstance configured at initialization time for theValidatorFactory.Returns theParameterNameProviderinstance configured at initialization time for theValidatorFactory.Returns the property node name provider used to resolve the name of a property node when creating the property path.Returns the factory responsible for creatingScriptEvaluators used to evaluate script expressions ofScriptAssertandParameterScriptAssertconstraints.Returns the temporal validation tolerance i.e. the acceptable margin of error when comparing date/time in temporal constraints.Returns theTraversableResolverinstance configured at initialization time for theValidatorFactory.Returns an initializedValidatorinstance using the factory defaults for message interpolator, traversable resolver and constraint validator factory.booleanboolean<T> TReturns an instance of the specified type allowing access to provider-specific APIs.Returns a context for validator configuration via options from the Bean Validation API as well as specific ones from Hibernate Validator.
-
Constructor Details
-
ValidatorFactoryImpl
-
-
Method Details
-
getValidator
Description copied from interface:ValidatorFactoryReturns an initializedValidatorinstance using the factory defaults for message interpolator, traversable resolver and constraint validator factory.Validator instances can be pooled and shared by the implementation.
- Specified by:
getValidatorin interfaceValidatorFactory- Returns:
- an initialized
Validatorinstance
-
getMessageInterpolator
Description copied from interface:ValidatorFactoryReturns theMessageInterpolatorinstance configured at initialization time for theValidatorFactory. This is the instance used byValidatorFactory.getValidator().- Specified by:
getMessageInterpolatorin interfaceValidatorFactory- Returns:
MessageInterpolatorinstance
-
getTraversableResolver
Description copied from interface:ValidatorFactoryReturns theTraversableResolverinstance configured at initialization time for theValidatorFactory. This is the instance used byValidatorFactory.getValidator().- Specified by:
getTraversableResolverin interfaceValidatorFactory- Returns:
TraversableResolverinstance
-
getConstraintValidatorFactory
Description copied from interface:ValidatorFactoryReturns theConstraintValidatorFactoryinstance configured at initialization time for theValidatorFactory. This is the instance used byValidatorFactory.getValidator().- Specified by:
getConstraintValidatorFactoryin interfaceValidatorFactory- Returns:
ConstraintValidatorFactoryinstance
-
getParameterNameProvider
Description copied from interface:ValidatorFactoryReturns theParameterNameProviderinstance configured at initialization time for theValidatorFactory. This is the instance used by #getValidator().- Specified by:
getParameterNameProviderin interfaceValidatorFactory- Returns:
ParameterNameProviderinstance
-
getExecutableParameterNameProvider
-
getClockProvider
Description copied from interface:ValidatorFactoryReturns theClockProviderinstance configured at initialization time for theValidatorFactory. This is the instance used by #getValidator().- Specified by:
getClockProviderin interfaceValidatorFactory- Returns:
ClockProviderinstance
-
getScriptEvaluatorFactory
Description copied from interface:HibernateValidatorFactoryReturns the factory responsible for creatingScriptEvaluators used to evaluate script expressions ofScriptAssertandParameterScriptAssertconstraints.- Specified by:
getScriptEvaluatorFactoryin interfaceHibernateValidatorFactory- Returns:
- a
ScriptEvaluatorFactoryinstance
-
getTemporalValidationTolerance
Description copied from interface:HibernateValidatorFactoryReturns the temporal validation tolerance i.e. the acceptable margin of error when comparing date/time in temporal constraints.- Specified by:
getTemporalValidationTolerancein interfaceHibernateValidatorFactory- Returns:
- the tolerance
-
getGetterPropertySelectionStrategy
Description copied from interface:HibernateValidatorFactoryReturns the getter property selection strategy defining the rules determining if a method is a getter or not.- Specified by:
getGetterPropertySelectionStrategyin interfaceHibernateValidatorFactory- Returns:
- the getter property selection strategy of the current
ValidatorFactory
-
getPropertyNodeNameProvider
Description copied from interface:HibernateValidatorFactoryReturns the property node name provider used to resolve the name of a property node when creating the property path.- Specified by:
getPropertyNodeNameProviderin interfaceHibernateValidatorFactory- Returns:
- the property node name provider of the current
ValidatorFactory
-
isFailFast
public boolean isFailFast() -
isTraversableResolverResultCacheEnabled
public boolean isTraversableResolverResultCacheEnabled() -
unwrap
Description copied from interface:ValidatorFactoryReturns an instance of the specified type allowing access to provider-specific APIs. If the Jakarta Bean Validation provider implementation does not support the specified class, aValidationExceptionis thrown.- Specified by:
unwrapin interfaceValidatorFactory- Type Parameters:
T- the type of the object to be returned- Parameters:
type- the class of the object to be returned- Returns:
- an instance of the specified class
-
usingContext
Description copied from interface:HibernateValidatorFactoryReturns a context for validator configuration via options from the Bean Validation API as well as specific ones from Hibernate Validator.- Specified by:
usingContextin interfaceHibernateValidatorFactory- Specified by:
usingContextin interfaceValidatorFactory- Returns:
- A context for validator configuration.
-
close
public void close()Description copied from interface:ValidatorFactoryCloses theValidatorFactoryinstance. After theValidatorFactoryinstance is closed, calling the following methods is not allowed:- methods of this
ValidatorFactoryinstance - methods of
Validatorinstances created by thisValidatorFactory
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceValidatorFactory
- methods of this
-
getValidatorFactoryScopedContext
-