类org.hibernate.validator.spi.resourceloading.ResourceBundleLocator源码实例Demo

下面列出了怎么用org.hibernate.validator.spi.resourceloading.ResourceBundleLocator的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: syndesis   文件: ValidatorContextResolver.java
@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 项目: lastaflute   文件: ActionValidator.java
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 项目: ameba   文件: ValidationFeature.java
private ResourceBundleLocator buildBundleLocator(final String name) {
    return locale -> Messages.getResourceBundle(name, locale);
}
 
 类所在包
 同包方法