Class Validation
- java.lang.Object
-
- de.knightsoftnet.validators.client.impl.Validation
-
public class Validation extends Object
This class is the entry point for Bean Validation. Bootstrapping is done as follows:{ @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
byProviderandproviderResolvermethods 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 Summary
Constructors Constructor Description Validation()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static javax.validation.ValidatorFactorybuildDefaultValidatorFactory()Build and return aValidatorFactoryinstance based on the default Bean Validation provider.static javax.validation.bootstrap.GenericBootstrapbyDefaultProvider()Build aConfiguration.static <T extends javax.validation.Configuration<T>,U extends javax.validation.spi.ValidationProvider<T>>
javax.validation.bootstrap.ProviderSpecificBootstrap<T>byProvider(Class<U> providerType)Unsupported.
-
-
-
Method Detail
-
buildDefaultValidatorFactory
public static javax.validation.ValidatorFactory buildDefaultValidatorFactory()
Build and return aValidatorFactoryinstance 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()- Returns:
ValidatorFactoryinstance.- Throws:
javax.validation.ValidationException- if the ValidatorFactory cannot be built
-
byDefaultProvider
public static javax.validation.bootstrap.GenericBootstrap byDefaultProvider()
Build aConfiguration.Configuration<?> configuration = Validation.byDefaultProvider().configure(); ValidatorFactory factory = configuration.buildValidatorFactory();
The first available provider will be returned.
- Returns:
- instance building a generic
Configurationcomplaint with the bootstrap state provided.
-
byProvider
public static <T extends javax.validation.Configuration<T>,U extends javax.validation.spi.ValidationProvider<T>> javax.validation.bootstrap.ProviderSpecificBootstrap<T> byProvider(Class<U> providerType)
Unsupported. Always throws anUnsupportedOperationException.- Type Parameters:
T- configuration typeU- validation provider type- Parameters:
providerType- class of the provider type- Returns:
- provider specific bootstrap
- Throws:
UnsupportedOperationException- not supported
-
-