public class Validation extends Object
{
@code
ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
}
Or, equivalently:
{
@code
Configuration<?> configuration = Validation.byDefaultProvider().configure();
ValidatorFactory factory = configuration.buildValidatorFactory();
}
Only the default provider is available for use, and thus the byProvider and
providerResolver methods are not supported. Calling either of these methods will generate
an exception.
This class was modified by Google from the original javax.validation.Validation source to make it suitable for GWT.
| Constructor and Description |
|---|
Validation() |
| Modifier and Type | Method and Description |
|---|---|
static javax.validation.ValidatorFactory |
buildDefaultValidatorFactory()
Build and return a
ValidatorFactory instance based on the default Bean Validation
provider. |
static javax.validation.bootstrap.GenericBootstrap |
byDefaultProvider()
Build a
Configuration. |
static <T extends javax.validation.Configuration<T>,U extends javax.validation.spi.ValidationProvider<T>> |
byProvider(Class<U> providerType)
Unsupported.
|
public static javax.validation.ValidatorFactory buildDefaultValidatorFactory()
ValidatorFactory instance based on the default Bean Validation
provider.
The provider list is resolved using the default validation provider resolver logic.
The code is semantically equivalent toValidation.byDefaultProvider().configure().buildValidatorFactory()ValidatorFactory instance.javax.validation.ValidationException - if the ValidatorFactory cannot be builtpublic static javax.validation.bootstrap.GenericBootstrap byDefaultProvider()
Configuration.
Configuration<?> configuration = Validation.byDefaultProvider().configure(); ValidatorFactory factory = configuration.buildValidatorFactory();
The first available provider will be returned.
Configuration complaint with the bootstrap
state provided.public static <T extends javax.validation.Configuration<T>,U extends javax.validation.spi.ValidationProvider<T>> javax.validation.bootstrap.ProviderSpecificBootstrap<T> byProvider(Class<U> providerType)
UnsupportedOperationException.T - configuration typeU - validation provider typeproviderType - class of the provider typeUnsupportedOperationException - not supportedCopyright © 2015–2019. All rights reserved.