Save This Page
Home » hibernate-validator-src-20081106 » javax.validation » [javadoc | source]
javax.validation
public class: Validation [javadoc | source]
java.lang.Object
   javax.validation.Validation
This class is the entry point for the Bean Validation framework. There are three ways to bootstrap the framework: Note:
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:
 public static SpecializedBuilderFactory builderType(Class builderType) 
    Build a 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.
 public static GenericBuilderFactory defineBootstrapState() 
    Build a 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.
 public static ValidatorFactoryBuilder getBuilder()