Java 类org.springframework.validation.DefaultMessageCodesResolver 实例源码

项目:spring4-understanding    文件:WebMvcConfigurationSupportExtensionTests.java   
@SuppressWarnings("serial")
@Override
public MessageCodesResolver getMessageCodesResolver() {
    return new DefaultMessageCodesResolver() {
        @Override
        public String[] resolveMessageCodes(String errorCode, String objectName) {
            return new String[] { "custom." + errorCode };
        }
    };
}
项目:spring4-understanding    文件:DelegatingWebMvcConfigurationTests.java   
@Test
public void getCustomMessageCodesResolver() {
    given(webMvcConfigurer.getMessageCodesResolver()).willReturn(new DefaultMessageCodesResolver());

    delegatingConfig.setConfigurers(Arrays.asList(webMvcConfigurer));
    delegatingConfig.getMessageCodesResolver();

    verify(webMvcConfigurer).getMessageCodesResolver();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcAutoConfiguration.java   
@Override
public MessageCodesResolver getMessageCodesResolver() {
    if (this.mvcProperties.getMessageCodesResolverFormat() != null) {
        DefaultMessageCodesResolver resolver = new DefaultMessageCodesResolver();
        resolver.setMessageCodeFormatter(
                this.mvcProperties.getMessageCodesResolverFormat());
        return resolver;
    }
    return null;
}
项目:spring-boot-concourse    文件:WebMvcAutoConfiguration.java   
@Override
public MessageCodesResolver getMessageCodesResolver() {
    if (this.mvcProperties.getMessageCodesResolverFormat() != null) {
        DefaultMessageCodesResolver resolver = new DefaultMessageCodesResolver();
        resolver.setMessageCodeFormatter(
                this.mvcProperties.getMessageCodesResolverFormat());
        return resolver;
    }
    return null;
}
项目:contestparser    文件:WebMvcAutoConfiguration.java   
@Override
public MessageCodesResolver getMessageCodesResolver() {
    if (this.mvcProperties.getMessageCodesResolverFormat() != null) {
        DefaultMessageCodesResolver resolver = new DefaultMessageCodesResolver();
        resolver.setMessageCodeFormatter(
                this.mvcProperties.getMessageCodesResolverFormat());
        return resolver;
    }
    return null;
}
项目:class-guard    文件:WebMvcConfigurationSupportExtensionTests.java   
@SuppressWarnings("serial")
@Override
public MessageCodesResolver getMessageCodesResolver() {
    return new DefaultMessageCodesResolver() {
        @Override
        public String[] resolveMessageCodes(String errorCode, String objectName) {
            return new String[] { "custom." + errorCode };
        }
    };
}
项目:class-guard    文件:DelegatingWebMvcConfigurationTests.java   
@Test
public void getCustomMessageCodesResolver() {
    given(webMvcConfigurer.getMessageCodesResolver()).willReturn(new DefaultMessageCodesResolver());

    delegatingConfig.setConfigurers(Arrays.asList(webMvcConfigurer));
    delegatingConfig.getMessageCodesResolver();

    verify(webMvcConfigurer).getMessageCodesResolver();
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcProperties.java   
public DefaultMessageCodesResolver.Format getMessageCodesResolverFormat() {
    return this.messageCodesResolverFormat;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:WebMvcProperties.java   
public void setMessageCodesResolverFormat(
        DefaultMessageCodesResolver.Format messageCodesResolverFormat) {
    this.messageCodesResolverFormat = messageCodesResolverFormat;
}
项目:spring-boot-concourse    文件:WebMvcProperties.java   
public DefaultMessageCodesResolver.Format getMessageCodesResolverFormat() {
    return this.messageCodesResolverFormat;
}
项目:spring-boot-concourse    文件:WebMvcProperties.java   
public void setMessageCodesResolverFormat(
        DefaultMessageCodesResolver.Format messageCodesResolverFormat) {
    this.messageCodesResolverFormat = messageCodesResolverFormat;
}
项目:contestparser    文件:WebMvcProperties.java   
public DefaultMessageCodesResolver.Format getMessageCodesResolverFormat() {
    return this.messageCodesResolverFormat;
}
项目:contestparser    文件:WebMvcProperties.java   
public void setMessageCodesResolverFormat(
        DefaultMessageCodesResolver.Format messageCodesResolverFormat) {
    this.messageCodesResolverFormat = messageCodesResolverFormat;
}