本文整理汇总了Java中javax.validation.ValidationProviderResolver类的典型用法代码示例。如果您正苦于以下问题:Java ValidationProviderResolver类的具体用法?Java ValidationProviderResolver怎么用?Java ValidationProviderResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ValidationProviderResolver类属于javax.validation包,在下文中一共展示了ValidationProviderResolver类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createConfiguration
import javax.validation.ValidationProviderResolver; //导入依赖的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: getDefaultValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
@Override
public ValidationProviderResolver getDefaultValidationProviderResolver() {
if (this.defaultResolver == null) {
this.defaultResolver = GWT.create(ValidationProviderResolver.class);
}
return this.defaultResolver;
}
示例3: getValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
public ValidationProviderResolver getValidationProviderResolver() {
return validationProviderResolver;
}
示例4: setValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
/**
* To use a a custom {@link ValidationProviderResolver}
*/
public void setValidationProviderResolver(ValidationProviderResolver validationProviderResolver) {
this.validationProviderResolver = validationProviderResolver;
}
示例5: buildValidatorFactory
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
public static ValidatorFactory buildValidatorFactory(boolean osgi,
ValidationProviderResolver validationProviderResolver,
MessageInterpolator messageInterpolator,
TraversableResolver traversableResolver,
ConstraintValidatorFactory constraintValidatorFactory) {
ValidationProviderResolver resolvedValidationProviderResolver =
resolveValidationProviderResolver(osgi, validationProviderResolver);
GenericBootstrap bootstrap = Validation.byDefaultProvider();
if (resolvedValidationProviderResolver != null) {
bootstrap.providerResolver(resolvedValidationProviderResolver);
}
Configuration<?> configuration = bootstrap.configure();
if (messageInterpolator != null) {
configuration.messageInterpolator(messageInterpolator);
}
if (traversableResolver != null) {
configuration.traversableResolver(traversableResolver);
}
if (constraintValidatorFactory != null) {
configuration.constraintValidatorFactory(constraintValidatorFactory);
}
return configuration.buildValidatorFactory();
}
示例6: getValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
@Override
public ValidationProviderResolver getValidationProviderResolver() {
return this.getDefaultValidationProviderResolver();
}
示例7: providerResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
/**
* Unsupported. Always throws an {@link UnsupportedOperationException}.
*
* @throws UnsupportedOperationException not supported
*/
@Override
public GenericBootstrap providerResolver(final ValidationProviderResolver resolver) {
throw new UnsupportedOperationException(
"GWT Validation does not support custom validator " + "provider resolvers");
}
示例8: resolveValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
/**
* Resolves optional custom {@code javax.validation.ValidationProviderResolver} to be used by the component. By
* default component tries to use resolver instance bound to the Camel registry under name
* {@code validationProviderResolver} . If there is no such resolver instance in the registry and component is
* running in the OSGi environment, {@link HibernateValidationProviderResolver} will be used. In all the other
* cases this method will return null.
*
* @param osgi specifies if validator factory should be OSGi-aware
* @param validationProviderResolver predefined provider resolver. This parameter overrides the results of the
* resolution.
* @return {@code javax.validation.ValidationProviderResolver} instance or null if no custom resolver should
* be used by the component
*/
private static ValidationProviderResolver resolveValidationProviderResolver(
boolean osgi,
ValidationProviderResolver validationProviderResolver) {
if (validationProviderResolver != null) {
return validationProviderResolver;
}
if (osgi) {
return new HibernateValidationProviderResolver();
}
return null;
}
示例9: setValidationProviderResolver
import javax.validation.ValidationProviderResolver; //导入依赖的package包/类
/**
* Specify a JSR-303 {@link ValidationProviderResolver} for bootstrapping the
* provider of choice, as an alternative to {@code META-INF} driven resolution.
* @since 4.3
*/
public void setValidationProviderResolver(ValidationProviderResolver validationProviderResolver) {
this.validationProviderResolver = validationProviderResolver;
}