当前位置: 首页>>代码示例>>Java>>正文


Java ValidationProvider类代码示例

本文整理汇总了Java中javax.validation.spi.ValidationProvider的典型用法代码示例。如果您正苦于以下问题:Java ValidationProvider类的具体用法?Java ValidationProvider怎么用?Java ValidationProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValidationProvider类属于javax.validation.spi包,在下文中一共展示了ValidationProvider类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConfiguration

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:bradwoo8621,项目名称:nest-old,代码行数:30,代码来源:HibernateValidationConfigurationInitializer.java

示例2: getValidator

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
/**
 * 线程安全的
 *
 * @return {@link Validator}
 */
public static Validator getValidator ( Class< ? extends ValidationProvider > providerType ) {
    return Validation.byProvider( providerType )
		 .configure()
		 .buildValidatorFactory()
		 .getValidator();
}
 
开发者ID:yujunhao8831,项目名称:spring-boot-start-current,代码行数:12,代码来源:HibernateValidatorPro.java

示例3: getValidationProviders

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
	return Collections.singletonList(new HibernateValidator());
}
 
开发者ID:AdeptJ,项目名称:adeptj-modules,代码行数:5,代码来源:OSGiValidationProviderResolver.java

示例4: getValidationProviders

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
  return Collections.<ValidationProvider<?>>singletonList(new HibernateValidator());
}
 
开发者ID:Cognifide,项目名称:aet,代码行数:5,代码来源:ValidatorProvider.java

示例5: OsgiValidationProviderTracker

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
public OsgiValidationProviderTracker ()
{
    final BundleContext context = FrameworkUtil.getBundle ( OsgiValidationProviderTracker.class ).getBundleContext ();

    this.tracker = new ServiceTracker<> ( context, ValidationProvider.class, null );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:7,代码来源:OsgiValidationProviderTracker.java

示例6: getValidationProviders

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders ()
{
    return new ArrayList<> ( this.tracker.getTracked ().values () );
}
 
开发者ID:eclipse,项目名称:packagedrone,代码行数:6,代码来源:OsgiValidationProviderTracker.java

示例7: createValidationProviderList

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
private static ArrayList<ValidationProvider<?>> createValidationProviderList() {
  final ArrayList<ValidationProvider<?>> temp = new ArrayList<>();
  final ValidationProvider<?> provider = GWT.create(ValidationProvider.class);
  temp.add(provider);
  return temp;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:7,代码来源:GwtValidationProviderResolver.java

示例8: getValidationProviders

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
  return DEFAULT_LIST;
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:5,代码来源:GwtValidationProviderResolver.java

示例9: NullConfig

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
public NullConfig(final BootstrapState aState, final ValidationProvider<?> aProvider) {
    super(aState, aProvider);
}
 
开发者ID:apache,项目名称:tomee,代码行数:4,代码来源:CustomValidatorProvider.java

示例10: getValidationProviders

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
    return ImmutableList.<ValidationProvider<?>>of(new HibernateValidator());
}
 
开发者ID:wisdom-framework,项目名称:wisdom,代码行数:5,代码来源:HibernateValidationProviderResolver.java

示例11: byProvider

import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
/**
 * 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");
}
 
开发者ID:ManfredTremmel,项目名称:gwt-bean-validators,代码行数:14,代码来源:Validation.java


注:本文中的javax.validation.spi.ValidationProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。