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

项目: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);
}
项目:syndesis-rest    文件: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);
}
项目: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);
    };
}
项目:ameba    文件:ValidationFeature.java   
private ResourceBundleLocator buildBundleLocator(final String name) {
    return locale -> Messages.getResourceBundle(name, locale);
}
项目:yottr    文件:CustomMessageInterpolator.java   
public CustomMessageInterpolator(ResourceBundleLocator userResourceBundleLocator) {
    super(userResourceBundleLocator);
}
项目:yottr    文件:CustomMessageInterpolator.java   
public CustomMessageInterpolator(ResourceBundleLocator userResourceBundleLocator, boolean cacheMessages) {
    super(userResourceBundleLocator, cacheMessages);
}