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.

Author:
Emmanuel Bernard, Hardy Ferentschik

Method Summary
 ValidatorFactory buildValidatorFactory(ConfigurationState configurationState)
          Build a ValidatorFactory using the current provider implementation.
 Configuration<?> createGenericConfiguration(BootstrapState state)
          Returns a Configuration instance.
 T createSpecializedConfiguration(BootstrapState state)
          Returns a Configuration instance implementing T, the Configuration subinterface.
 

Method Detail

createSpecializedConfiguration

T createSpecializedConfiguration(BootstrapState state)
Returns a Configuration instance implementing T, the Configuration subinterface. The returned Configuration instance must use the current provider (this) to build the ValidatorFactory instance.

Parameters:
state - bootstrap state
Returns:
specific Configuration implementation

createGenericConfiguration

Configuration<?> createGenericConfiguration(BootstrapState state)
Returns a Configuration instance. This instance is not bound to use the current provider. The choice of provider follows the algorithm described in Configuration

The ValidationProviderResolver used by Configuration is provided by state. If null, the default ValidationProviderResolver is used.

Parameters:
state - bootstrap state
Returns:
Non specialized Configuration implementation

buildValidatorFactory

ValidatorFactory buildValidatorFactory(ConfigurationState configurationState)
Build a ValidatorFactory using the current provider implementation. The ValidatorFactory is assembled and follows the configuration passed via ConfigurationState.

The returned ValidatorFactory is properly initialized and ready for use.

Parameters:
configurationState - the configuration descriptor
Returns:
the instanciated ValidatorFactory
Throws:
ValidationException - if the ValidatorFactory cannot be built


Submit a bug or feature

Copyright © 2009, 2010, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 4-June-2010 04:34