public T configure() { if ( validationProviderClass == null ) { throw new ValidationException( "builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism" ); GenericBootstrapImpl state = new GenericBootstrapImpl(); return provider.createSpecializedConfiguration( state ); state.providerResolver( resolver ); resolvers = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); if ( validationProviderClass.isAssignableFrom( provider.getClass() ) ) { ValidationProvider<T> specificProvider = validationProviderClass.cast( provider ); return specificProvider.createSpecializedConfiguration( state ); throw new ValidationException( "Unable to find provider: " + validationProviderClass );
@Override public Configuration<?> configure() { ValidationProviderResolver resolver = this.resolver == null ? getDefaultValidationProviderResolver() : this.resolver; validationProviders = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); config = resolver.getValidationProviders().get( 0 ).createGenericConfiguration( this ); throw new ValidationException( "Unable to instantiate Configuration.", re );
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Build a <code>Configuration</code>. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exsist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic <code>Configuration</code> * compliant with the bootstrap state provided. */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
/** * Builds a {@link Configuration}. The provider list is resolved * using the strategy provided to the bootstrap state. * <pre> * Configuration<?> configuration = Validation * .byDefaultProvider() * .providerResolver( new MyResolverStrategy() ) * .configure(); * ValidatorFactory factory = configuration.buildValidatorFactory(); * </pre> * The provider can be specified in the XML configuration. If the XML * configuration does not exist or if no provider is specified, * the first available provider will be returned. * * @return instance building a generic {@code Configuration} * compliant with the bootstrap state provided */ public static GenericBootstrap byDefaultProvider() { return new GenericBootstrapImpl(); }
public Configuration<?> configure() { ValidationProviderResolver resolv = vpResolver; try { if (resolv == null) resolv = getDefaultValidationProviderResolver(); return resolv.getValidationProviders().get(0).createGenericConfiguration(this); } catch (Exception e) { throw new ValidationException("Could not create Configuration.", e); } } }
public T configure() { if (providerClass == null) throw new ValidationException("No resolver provided"); // create a default resolver if not supplied by providerResolver() GenericBootstrapImpl impl = new GenericBootstrapImpl(); if ( vpResolver == null ) vpResolver = impl.getDefaultValidationProviderResolver(); else impl.providerResolver(vpResolver); // check each provider discovered by the resolver for (ValidationProvider<?> vProvider : vpResolver.getValidationProviders()) { if (providerClass.isAssignableFrom(vProvider.getClass())) { // Create a ValidationProvider<T> from the above bootstrap impl // and configurationType return providerClass.cast(vProvider).createSpecializedConfiguration(impl); } } // throw a Spec required exception throw new ValidationException("No provider found for " + providerClass); } }
public Configuration<?> configure() { ValidationProviderResolver resolv = vpResolver; try { if (resolv == null) resolv = getDefaultValidationProviderResolver(); return resolv.getValidationProviders().get(0).createGenericConfiguration(this); } catch (Exception e) { throw new ValidationException("Could not create Configuration.", e); } } }
public T configure() { if (providerClass == null) throw new ValidationException("No resolver provided"); // create a default resolver if not supplied by providerResolver() GenericBootstrapImpl impl = new GenericBootstrapImpl(); if ( vpResolver == null ) vpResolver = impl.getDefaultValidationProviderResolver(); else impl.providerResolver(vpResolver); // check each provider discovered by the resolver for (ValidationProvider<?> vProvider : vpResolver.getValidationProviders()) { if (providerClass.isAssignableFrom(vProvider.getClass())) { // Create a ValidationProvider<T> from the above bootstrap impl // and configurationType return providerClass.cast(vProvider).createSpecializedConfiguration(impl); } } // throw a Spec required exception throw new ValidationException("No provider found for " + providerClass); } }
public Configuration<?> configure() { ValidationProviderResolver resolver = this.resolver == null ? getDefaultValidationProviderResolver() : this.resolver; List<ValidationProvider<?>> resolvers; try { resolvers = resolver.getValidationProviders(); } catch ( RuntimeException re ) { throw new ValidationException( "Unable to get available provider resolvers.", re ); } if ( resolvers.size() == 0 ) { //FIXME looks like an assertion error almost throw new ValidationException( "Unable to find a default provider" ); } Configuration<?> config; try { config = resolver.getValidationProviders().get( 0 ).createGenericConfiguration( this ); } catch ( RuntimeException re ) { throw new ValidationException( "Unable to instantiate Configuration.", re ); } return config; } }
throw new ValidationException( "builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism" ); GenericBootstrapImpl state = new GenericBootstrapImpl(); if ( resolver == null ) { resolver = state.getDefaultValidationProviderResolver(); state.providerResolver( resolver ); resolvers = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); if ( validationProviderClass.isAssignableFrom( provider.getClass() ) ) { ValidationProvider<T> specificProvider = validationProviderClass.cast( provider ); return specificProvider.createSpecializedConfiguration( state ); throw new ValidationException( "Unable to find provider: " + validationProviderClass );
public Configuration<?> configure() { ValidationProviderResolver resolver = this.resolver == null ? getDefaultValidationProviderResolver() : this.resolver; validationProviders = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); String msg = "Unable to create a Configuration, because no Bean Validation provider could be found." + " Add a provider like Hibernate Validator (RI) to your classpath."; throw new ValidationException( msg ); config = resolver.getValidationProviders().get( 0 ).createGenericConfiguration( this ); throw new ValidationException( "Unable to instantiate Configuration.", re );
throw new ValidationException( "builder is mandatory. Use Validation.byDefaultProvider() to use the generic provider discovery mechanism" ); GenericBootstrapImpl state = new GenericBootstrapImpl(); if ( resolver == null ) { resolver = state.getDefaultValidationProviderResolver(); state.providerResolver( resolver ); resolvers = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); if ( validationProviderClass.isAssignableFrom( provider.getClass() ) ) { ValidationProvider<T> specificProvider = validationProviderClass.cast( provider ); return specificProvider.createSpecializedConfiguration( state ); throw new ValidationException( "Unable to find provider: " + validationProviderClass );
public Configuration<?> configure() { ValidationProviderResolver resolver = this.resolver == null ? getDefaultValidationProviderResolver() : this.resolver; validationProviders = resolver.getValidationProviders(); throw new ValidationException( "Unable to get available provider resolvers.", re ); String msg = "Unable to create a Configuration, because no Bean Validation provider could be found." + " Add a provider like Hibernate Validator (RI) to your classpath."; throw new ValidationException( msg ); config = resolver.getValidationProviders().get( 0 ).createGenericConfiguration( this ); throw new ValidationException( "Unable to instantiate Configuration.", re );