public class ValidatorFactoryImpl extends Object implements HibernateValidatorFactory
Validator
instances. This is the Hibernate Validator default
implementation of the ValidatorFactory
interface.Constructor and Description |
---|
ValidatorFactoryImpl(ConfigurationState configurationState) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the
ValidatorFactory instance. |
ClockProvider |
getClockProvider()
Returns the
ClockProvider instance configured at
initialization time for the ValidatorFactory . |
ConstraintValidatorFactory |
getConstraintValidatorFactory()
Returns the
ConstraintValidatorFactory instance
configured at initialization time for the
ValidatorFactory . |
ExecutableParameterNameProvider |
getExecutableParameterNameProvider() |
MessageInterpolator |
getMessageInterpolator()
Returns the
MessageInterpolator instance configured at
initialization time for the ValidatorFactory . |
ParameterNameProvider |
getParameterNameProvider()
Returns the
ParameterNameProvider instance configured at
initialization time for the ValidatorFactory . |
ScriptEvaluatorFactory |
getScriptEvaluatorFactory()
Returns the factory responsible for creating
ScriptEvaluator s used to
evaluate script expressions of ScriptAssert and ParameterScriptAssert
constraints. |
Duration |
getTemporalValidationTolerance()
Returns the temporal validation tolerance i.e.
|
TraversableResolver |
getTraversableResolver()
Returns the
TraversableResolver instance configured
at initialization time for the ValidatorFactory . |
Validator |
getValidator()
Returns an initialized
Validator instance using the
factory defaults for message interpolator, traversable resolver
and constraint validator factory. |
org.hibernate.validator.internal.engine.ValidatorFactoryImpl.ValidatorFactoryScopedContext |
getValidatorFactoryScopedContext() |
boolean |
isFailFast() |
boolean |
isTraversableResolverResultCacheEnabled() |
<T> T |
unwrap(Class<T> type)
Returns an instance of the specified type allowing access to
provider-specific APIs.
|
HibernateValidatorContext |
usingContext()
Returns a context for validator configuration via options from the
Bean Validation API as well as specific ones from Hibernate Validator.
|
public ValidatorFactoryImpl(ConfigurationState configurationState)
public Validator getValidator()
ValidatorFactory
Validator
instance using the
factory defaults for message interpolator, traversable resolver
and constraint validator factory.
Validator instances can be pooled and shared by the implementation.
getValidator
in interface ValidatorFactory
Validator
instancepublic MessageInterpolator getMessageInterpolator()
ValidatorFactory
MessageInterpolator
instance configured at
initialization time for the ValidatorFactory
.
This is the instance used by ValidatorFactory.getValidator()
.getMessageInterpolator
in interface ValidatorFactory
MessageInterpolator
instancepublic TraversableResolver getTraversableResolver()
ValidatorFactory
TraversableResolver
instance configured
at initialization time for the ValidatorFactory
.
This is the instance used by ValidatorFactory.getValidator()
.getTraversableResolver
in interface ValidatorFactory
TraversableResolver
instancepublic ConstraintValidatorFactory getConstraintValidatorFactory()
ValidatorFactory
ConstraintValidatorFactory
instance
configured at initialization time for the
ValidatorFactory
.
This is the instance used by ValidatorFactory.getValidator()
.getConstraintValidatorFactory
in interface ValidatorFactory
ConstraintValidatorFactory
instancepublic ParameterNameProvider getParameterNameProvider()
ValidatorFactory
ParameterNameProvider
instance configured at
initialization time for the ValidatorFactory
.
This is the instance used by #getValidator().getParameterNameProvider
in interface ValidatorFactory
ParameterNameProvider
instancepublic ExecutableParameterNameProvider getExecutableParameterNameProvider()
public ClockProvider getClockProvider()
ValidatorFactory
ClockProvider
instance configured at
initialization time for the ValidatorFactory
.
This is the instance used by #getValidator().getClockProvider
in interface ValidatorFactory
ClockProvider
instancepublic ScriptEvaluatorFactory getScriptEvaluatorFactory()
HibernateValidatorFactory
ScriptEvaluator
s used to
evaluate script expressions of ScriptAssert
and ParameterScriptAssert
constraints.getScriptEvaluatorFactory
in interface HibernateValidatorFactory
ScriptEvaluatorFactory
instancepublic Duration getTemporalValidationTolerance()
HibernateValidatorFactory
getTemporalValidationTolerance
in interface HibernateValidatorFactory
public boolean isFailFast()
public boolean isTraversableResolverResultCacheEnabled()
public <T> T unwrap(Class<T> type)
ValidatorFactory
ValidationException
is thrown.unwrap
in interface ValidatorFactory
T
- the type of the object to be returnedtype
- the class of the object to be returnedpublic HibernateValidatorContext usingContext()
HibernateValidatorFactory
usingContext
in interface ValidatorFactory
usingContext
in interface HibernateValidatorFactory
public void close()
ValidatorFactory
ValidatorFactory
instance.
After the ValidatorFactory
instance is closed, calling the following
methods is not allowed:
ValidatorFactory
instanceValidator
instances created by this
ValidatorFactory
close
in interface AutoCloseable
close
in interface ValidatorFactory
public org.hibernate.validator.internal.engine.ValidatorFactoryImpl.ValidatorFactoryScopedContext getValidatorFactoryScopedContext()
Copyright © 2021 JBoss by Red Hat. All rights reserved.