当前位置: 首页>>代码示例>>Java>>正文


Java ResourceBundleMessageInterpolator类代码示例

本文整理汇总了Java中org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator的典型用法代码示例。如果您正苦于以下问题:Java ResourceBundleMessageInterpolator类的具体用法?Java ResourceBundleMessageInterpolator怎么用?Java ResourceBundleMessageInterpolator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ResourceBundleMessageInterpolator类属于org.hibernate.validator.messageinterpolation包,在下文中一共展示了ResourceBundleMessageInterpolator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createConfiguration

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的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;
}
 
开发者ID:bradwoo8621,项目名称:nest-old,代码行数:30,代码来源:HibernateValidationConfigurationInitializer.java

示例2: getContext

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的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);
}
 
开发者ID:syndesisio,项目名称:syndesis,代码行数:15,代码来源:ValidatorContextResolver.java

示例3: getContext

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
@Override
public ValidationConfig getContext(final Class<?> type) {
    return new ValidationConfig()
            .constraintValidatorFactory(resourceContext.getResource(InjectingConstraintValidatorFactory.class))
            .parameterNameProvider(new ParanamerParameterNameProvider())
            .messageInterpolator(
                    new ResourceBundleMessageInterpolator(
                            buildBundleLocator(VALIDATION_MESSAGE_BUNDLE_NAME),
                            buildBundleLocator(Messages.BUNDLE_NAME),
                            mode.isProd()
                    )
            );
}
 
开发者ID:icode,项目名称:ameba,代码行数:14,代码来源:ValidationFeature.java

示例4: getContext

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public ValidationConfig getContext(Class<?> type) {
    return new ValidationConfig()
            .messageInterpolator(
                    // TODO: ResourceBundleMessageInterpolator always return default messages
                    new ResourceBundleMessageInterpolator(
                            new PlatformResourceBundleLocator(Messages.RESOURCE_BUNDLE_BASE_NAME)));
}
 
开发者ID:dan-zx,项目名称:zekke-webapp,代码行数:12,代码来源:WebServiceConfig.java

示例5: buildMessageInterpolator

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
public static MessageInterpolator buildMessageInterpolator(MessageSource messageSource) {
	return new ResourceBundleMessageInterpolator(new MessageSourceResourceBundleLocator(messageSource));
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:4,代码来源:LocalValidatorFactoryBean.java

示例6: validator

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
@Bean
public LocalValidatorFactoryBean validator() {
    LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean();
    bean.setMessageInterpolator(new ResourceBundleMessageInterpolator());
    return bean;
}
 
开发者ID:mattpwest,项目名称:entelect-spring-webapp-template,代码行数:7,代码来源:SpringMVCConfig.java

示例7: newResourceBundleMessageInterpolator

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
protected ResourceBundleMessageInterpolator newResourceBundleMessageInterpolator() {
    return new ResourceBundleMessageInterpolator(newResourceBundleLocator());
}
 
开发者ID:lastaflute,项目名称:lastaflute,代码行数:4,代码来源:ActionValidator.java

示例8: MessageResolverInterpolator

import org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator; //导入依赖的package包/类
public MessageResolverInterpolator(final MessageResolver messageResolver) {
    ArgUtils.notNull("messageResolver", "messageResolver");
    this.messageInterpolator = new ResourceBundleMessageInterpolator(
            new MessageResolverResourceBundleLocator(messageResolver));
}
 
开发者ID:mygreen,项目名称:xlsmapper,代码行数:6,代码来源:MessageResolverInterpolator.java


注:本文中的org.hibernate.validator.messageinterpolation.ResourceBundleMessageInterpolator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。