Package javax.validation.spi
Interface ValidationProvider<T extends Configuration<T>>
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.
T represents the provider specific Configuration subclass
which typically host provider's additional configuration methods.-
Method Summary
Modifier and TypeMethodDescriptionbuildValidatorFactory(ConfigurationState configurationState) Build aValidatorFactoryusing the current provider implementation.Returns aConfigurationinstance.
-
Method Details
-
createSpecializedConfiguration
Returns aConfigurationinstance implementingT, theConfigurationsub-interface. The returnedConfigurationinstance must use the current provider (this) to build theValidatorFactoryinstance.- Parameters:
state- bootstrap state- Returns:
- specific
Configurationimplementation
-
createGenericConfiguration
Returns aConfigurationinstance. This instance is not bound to use the current provider. The choice of provider follows the algorithm described inConfigurationTheValidationProviderResolverused byConfigurationis provided bystate. If null, the defaultValidationProviderResolveris used.- Parameters:
state- bootstrap state- Returns:
- non specialized Configuration implementation
-
buildValidatorFactory
Build aValidatorFactoryusing the current provider implementation. TheValidatorFactoryis assembled and follows the configuration passed viaConfigurationState. The returnedValidatorFactoryis properly initialized and ready for use.- Parameters:
configurationState- the configuration descriptor- Returns:
- the instantiated
ValidatorFactory - Throws:
ValidationException- if theValidatorFactorycannot be built
-