Package jakarta.validation.spi
Interface ValidationProvider<T extends Configuration<T>>
- Type Parameters:
T
- the provider specific Configuration subclass which typically host provider's additional configuration methods
public interface ValidationProvider<T extends Configuration<T>>
Contract between the validation bootstrap mechanism and the provider engine.
Implementations must have a public no-arg constructor. The construction of a provider should be as "lightweight" as possible.
- Author:
- Emmanuel Bernard, Hardy Ferentschik
-
Method Summary
Modifier and TypeMethodDescriptionbuildValidatorFactory
(ConfigurationState configurationState) Build aValidatorFactory
using the current provider implementation.Returns aConfiguration
instance.
-
Method Details
-
createSpecializedConfiguration
Returns aConfiguration
instance implementingT
, theConfiguration
sub-interface. The returnedConfiguration
instance must use the current provider (this
) to build theValidatorFactory
instance.- Parameters:
state
- bootstrap state- Returns:
- specific
Configuration
implementation
-
createGenericConfiguration
Returns aConfiguration
instance. This instance is not bound to use the current provider. The choice of provider follows the algorithm described inConfiguration
The
ValidationProviderResolver
used byConfiguration
is provided bystate
. If null, the defaultValidationProviderResolver
is used.- Parameters:
state
- bootstrap state- Returns:
- non specialized Configuration implementation
-
buildValidatorFactory
Build aValidatorFactory
using the current provider implementation.The
ValidatorFactory
is assembled and follows the configuration passed viaConfigurationState
.The returned
ValidatorFactory
is properly initialized and ready for use.- Parameters:
configurationState
- the configuration descriptor- Returns:
- the instantiated
ValidatorFactory
- Throws:
ValidationException
- if theValidatorFactory
cannot be built
-