本文整理汇总了Java中org.hibernate.validator.spi.resourceloading.ResourceBundleLocator类的典型用法代码示例。如果您正苦于以下问题:Java ResourceBundleLocator类的具体用法?Java ResourceBundleLocator怎么用?Java ResourceBundleLocator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ResourceBundleLocator类属于org.hibernate.validator.spi.resourceloading包,在下文中一共展示了ResourceBundleLocator类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getContext
import org.hibernate.validator.spi.resourceloading.ResourceBundleLocator; //导入依赖的package包/类
@Override
public GeneralValidator getContext(final Class<?> type) {
final ResourceBundleLocator resourceBundleLocator = new PlatformResourceBundleLocator("messages");
final MessageInterpolator messageInterpolator = new ResourceBundleMessageInterpolator(resourceBundleLocator);
final Configuration<?> config = Validation.byDefaultProvider().configure()
.messageInterpolator(messageInterpolator);
final BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();
final boolean isExecutableValidationEnabled = bootstrapConfiguration.isExecutableValidationEnabled();
final Set<ExecutableType> defaultValidatedExecutableTypes = bootstrapConfiguration
.getDefaultValidatedExecutableTypes();
return new GeneralValidatorImpl(validatorFactory, isExecutableValidationEnabled,
defaultValidatedExecutableTypes);
}
示例2: newResourceBundleLocator
import org.hibernate.validator.spi.resourceloading.ResourceBundleLocator; //导入依赖的package包/类
protected ResourceBundleLocator newResourceBundleLocator() {
return ignoredLocale -> {
// not used default locacle managed in Hibernate validator,
// all messages use provided locale (e.g. request locale)
// to match with other message's locale
final Locale provided = messageLocaleProvider.provide();
return newHookedResourceBundle(provided);
};
}
示例3: buildBundleLocator
import org.hibernate.validator.spi.resourceloading.ResourceBundleLocator; //导入依赖的package包/类
private ResourceBundleLocator buildBundleLocator(final String name) {
return locale -> Messages.getResourceBundle(name, locale);
}
示例4: CustomMessageInterpolator
import org.hibernate.validator.spi.resourceloading.ResourceBundleLocator; //导入依赖的package包/类
public CustomMessageInterpolator(ResourceBundleLocator userResourceBundleLocator) {
super(userResourceBundleLocator);
}