Java 类javax.validation.BootstrapConfiguration 实例源码

项目: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);
}
项目:jaxrs-beanvalidation-javaee7    文件:ValidationConfigurationContextResolver.java   
/**
 * Get a context of type {@code GeneralValidator} that is applicable to the supplied type.
 *
 * @param type the class of object for which a context is desired
 * @return a context for the supplied type or {@code null} if a context for the supplied type is not available from
 *         this provider.
 */
@Override
public GeneralValidator getContext(Class<?> type) {
    Configuration<?> config = Validation.byDefaultProvider().configure();
    BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();

    config.messageInterpolator(new LocaleSpecificMessageInterpolator(Validation.byDefaultProvider().configure()
            .getDefaultMessageInterpolator()));
    config.parameterNameProvider(new CustomParameterNameProvider());

    return new GeneralValidatorImpl(config.buildValidatorFactory(),
            bootstrapConfiguration.isExecutableValidationEnabled(),
            bootstrapConfiguration.getDefaultValidatedExecutableTypes());
}
项目:minijax    文件:MinijaxValidationProvider.java   
@Override
public BootstrapConfiguration getBootstrapConfiguration() {
    throw new UnsupportedOperationException();
}
项目:adeptj-modules    文件:OSGiBeanValidatorService.java   
public OSGiBeanValidatorService(Validator validator, BootstrapConfiguration bootstrapConfig) {
    this.validator = validator;
    this.bootstrapConfig = bootstrapConfig;
}
项目:adeptj-modules    文件:OSGiBeanValidatorService.java   
@Override
public BootstrapConfiguration getBootstrapConfiguration() {
    return bootstrapConfig;
}
项目:gwt-bean-validators    文件:GwtConfiguration.java   
@Override
public BootstrapConfiguration getBootstrapConfiguration() {
  throw new UnsupportedOperationException("GWT does not support xml configuration");
}
项目:tomee    文件:ValidatorBuilder.java   
public OpenEjbConfig(final BootstrapConfiguration bootstrapConfig, final Configuration<T> target) {
    bootstrap = bootstrapConfig;
    delegate = target;
}
项目:tomee    文件:ValidatorBuilder.java   
@Override
public BootstrapConfiguration getBootstrapConfiguration() {
    return bootstrap;
}
项目:adeptj-modules    文件:ValidatorService.java   
BootstrapConfiguration getBootstrapConfiguration();