Java 类javax.validation.spi.ValidationProvider 实例源码

项目:nest-old    文件:HibernateValidationConfigurationInitializer.java   
/**
 * create hibernate validation configuration
 * 
 * @return
 */
protected HibernateValidatorConfiguration createConfiguration() {
    HibernateValidatorConfiguration configuration = null;
    if (this.isIgnoreClassHierarchy()) {
        ValidationProviderResolver resolver = new ValidationProviderResolver() {
            /**
             * (non-Javadoc)
             * 
             * @see javax.validation.ValidationProviderResolver#getValidationProviders()
             */
            @Override
            public List<ValidationProvider<?>> getValidationProviders() {
                List<ValidationProvider<?>> providers = new ArrayList<ValidationProvider<?>>(1);
                providers.add(new HibernateValidator513());
                return providers;
            }
        };
        configuration = Validation.byProvider(HibernateValidator513.class).providerResolver(resolver).configure();
    } else {
        configuration = Validation.byProvider(HibernateValidator.class).configure();
    }
    configuration.messageInterpolator(new ResourceBundleMessageInterpolator(new PlatformResourceBundleLocator(
            MESSAGES)));
    return configuration;
}
项目:spring-boot-start-current    文件:HibernateValidatorPro.java   
/**
 * 线程安全的
 *
 * @return {@link Validator}
 */
public static Validator getValidator ( Class< ? extends ValidationProvider > providerType ) {
    return Validation.byProvider( providerType )
         .configure()
         .buildValidatorFactory()
         .getValidator();
}
项目:adeptj-modules    文件:OSGiValidationProviderResolver.java   
@Override
public List<ValidationProvider<?>> getValidationProviders() {
    return Collections.singletonList(new HibernateValidator());
}
项目:aet    文件:ValidatorProvider.java   
@Override
public List<ValidationProvider<?>> getValidationProviders() {
  return Collections.<ValidationProvider<?>>singletonList(new HibernateValidator());
}
项目:packagedrone    文件:OsgiValidationProviderTracker.java   
public OsgiValidationProviderTracker ()
{
    final BundleContext context = FrameworkUtil.getBundle ( OsgiValidationProviderTracker.class ).getBundleContext ();

    this.tracker = new ServiceTracker<> ( context, ValidationProvider.class, null );
}
项目:packagedrone    文件:OsgiValidationProviderTracker.java   
@Override
public List<ValidationProvider<?>> getValidationProviders ()
{
    return new ArrayList<> ( this.tracker.getTracked ().values () );
}
项目:gwt-bean-validators    文件:GwtValidationProviderResolver.java   
private static ArrayList<ValidationProvider<?>> createValidationProviderList() {
  final ArrayList<ValidationProvider<?>> temp = new ArrayList<>();
  final ValidationProvider<?> provider = GWT.create(ValidationProvider.class);
  temp.add(provider);
  return temp;
}
项目:gwt-bean-validators    文件:GwtValidationProviderResolver.java   
@Override
public List<ValidationProvider<?>> getValidationProviders() {
  return DEFAULT_LIST;
}
项目:package-drone    文件:OsgiValidationProviderTracker.java   
public OsgiValidationProviderTracker ()
{
    final BundleContext context = FrameworkUtil.getBundle ( OsgiValidationProviderTracker.class ).getBundleContext ();

    this.tracker = new ServiceTracker<> ( context, ValidationProvider.class, null );
}
项目:package-drone    文件:OsgiValidationProviderTracker.java   
@Override
public List<ValidationProvider<?>> getValidationProviders ()
{
    return new ArrayList<> ( this.tracker.getTracked ().values () );
}
项目:tomee    文件:CustomValidatorProvider.java   
public NullConfig(final BootstrapState aState, final ValidationProvider<?> aProvider) {
    super(aState, aProvider);
}
项目:wisdom    文件:HibernateValidationProviderResolver.java   
@Override
public List<ValidationProvider<?>> getValidationProviders() {
    return ImmutableList.<ValidationProvider<?>>of(new HibernateValidator());
}
项目:gwt-bean-validators    文件:Validation.java   
/**
 * Unsupported. Always throws an {@link UnsupportedOperationException}.
 *
 * @param providerType
 *
 * @throws UnsupportedOperationException not supported
 */
public static <T extends Configuration<T>, U extends ValidationProvider<T>> //
    ProviderSpecificBootstrap<T> //
    byProvider(final Class<U> providerType) {
  throw new UnsupportedOperationException(
      "GWT Validation does not support custom validator " + "providers");
}