本文整理汇总了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;
}
示例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();
}
示例3: getValidationProviders
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
return Collections.singletonList(new HibernateValidator());
}
示例4: getValidationProviders
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
return Collections.<ValidationProvider<?>>singletonList(new HibernateValidator());
}
示例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 );
}
示例6: getValidationProviders
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders ()
{
return new ArrayList<> ( this.tracker.getTracked ().values () );
}
示例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;
}
示例8: getValidationProviders
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
return DEFAULT_LIST;
}
示例9: NullConfig
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
public NullConfig(final BootstrapState aState, final ValidationProvider<?> aProvider) {
super(aState, aProvider);
}
示例10: getValidationProviders
import javax.validation.spi.ValidationProvider; //导入依赖的package包/类
@Override
public List<ValidationProvider<?>> getValidationProviders() {
return ImmutableList.<ValidationProvider<?>>of(new HibernateValidator());
}
示例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");
}