Interface Configuration<T extends Configuration<T>>

Type Parameters:
T - the type of a provider-specific specialization of this contract

public interface Configuration<T extends Configuration<T>>
Receives configuration information, selects the appropriate Jakarta Validation provider and builds the appropriate ValidatorFactory.

Usage:

 //provided by one of the Validation bootstrap methods
 Configuration<?> configuration =
     ValidatorFactory = configuration
         .messageInterpolator( new CustomMessageInterpolator() )
         .buildValidatorFactory();
 

By default, the configuration information is retrieved from META-INF/validation.xml. It is possible to override the configuration retrieved from the XML file by using one or more of the Configuration methods.

The ValidationProviderResolver is specified at configuration time (see ValidationProvider). If none is explicitly requested, the default ValidationProviderResolver is used.

The provider is selected in the following way:

  • if a specific provider is requested programmatically using Validation.byProvider(Class), find the first provider implementing the provider class requested and use it
  • if a specific provider is requested in META-INF/validation.xml, find the first provider implementing the provider class requested and use it
  • otherwise, use the first provider returned by the ValidationProviderResolver

Implementations are not meant to be thread-safe.