@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); }
/** * 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()); }
@Override public BootstrapConfiguration getBootstrapConfiguration() { throw new UnsupportedOperationException(); }
public OSGiBeanValidatorService(Validator validator, BootstrapConfiguration bootstrapConfig) { this.validator = validator; this.bootstrapConfig = bootstrapConfig; }
@Override public BootstrapConfiguration getBootstrapConfiguration() { return bootstrapConfig; }
@Override public BootstrapConfiguration getBootstrapConfiguration() { throw new UnsupportedOperationException("GWT does not support xml configuration"); }
public OpenEjbConfig(final BootstrapConfiguration bootstrapConfig, final Configuration<T> target) { bootstrap = bootstrapConfig; delegate = target; }
@Override public BootstrapConfiguration getBootstrapConfiguration() { return bootstrap; }
BootstrapConfiguration getBootstrapConfiguration();