java.lang.ObjectThis class is the entry point for the Bean Validation framework. There are three ways to bootstrap the framework:javax.validation.Validation
ValidatorFactory factory = Validation.getBuilder().build();In this case javax.validation.bootstrap.DefaultValidationProviderResolver will be used to locate available providers. The chosen provider is defined as followed:
ValidationProviderResolver. The chosen
ValidationProvider is then determined in the same way
as in the default bootstrapping case (see above).
ValidatorFactoryBuilder<?> builder = Validation .defineBootstrapState() .providerResolver( new MyResolverStrategy() ) .getBuilder(); ValidatorFactory factory = builder.build();
ValidatorFactoryBuilder sub-interface.
Optionally you can choose a custom ValidationProviderResolver.
ACMEValidatorFactoryBuilder builder = Validation .builderType(ACMEValidatorFactoryBuilder.class) .providerResolver( new MyResolverStrategy() ) // optionally set the provider resolver .getBuilder(); ValidatorFactory factory = builder.build();
Emmanuel - BernardHardy - Feretnschik| Method from javax.validation.Validation Summary: |
|---|
| builderType, defineBootstrapState, getBuilder |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from javax.validation.Validation Detail: |
|---|
ValidatorFactoryBuilder for a particular provider implementation.
Optionally override the provider resolution strategy used to determine the provider.
Used by applications targeting a specific provider programmatically.
ACMEValidatorFactoryBuilder builder = Validation.builderType(ACMEValidatorFactoryBuilder.class) .providerResolver( new MyResolverStrategy() ) .build();, where ACMEValidatorFactoryBuilder is the ValidatorFactoryBuilder
sub interface uniquely identifying the ACME Bean Validation provider. |
ValidatorFactoryBuilder. The provider list is resolved
using the strategy provided to the bootstrap state.
ValidatorFactoryBuilder<?> builder = Validation .defineBootstrapState() .providerResolver( new MyResolverStrategy() ) .getBuilder(); ValidatorFactory factory = builder.build();The actual provider choice is given by the XML configuration. If the XML configuration does not exsist the first available provider will be returned. |
ValidatorFactoryBuilder. The actual provider
choice is given by the XML configuration. If the
XML configuration does not exsist the default is taken.
The provider list is resolved using the
javax.validation.bootstrap.DefaultValidationProviderResolver . |