javax.validation.ParameterNameProvider Java Examples

The following examples show how to use javax.validation.ParameterNameProvider. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ValidationManager.java    From seed with Mozilla Public License 2.0 6 votes vote down vote up
public ValidatorFactory createValidatorFactory(Consumer<Configuration> customizer) {
    boolean skipAutoconfig = "false".equalsIgnoreCase(System.getProperty(SEEDSTACK_VALIDATION_AUTOCONFIG, "true"));
    boolean hasXmlConfiguration = findMostCompleteClassLoader(ValidationManager.class)
            .getResource(VALIDATION_XML_FILE) != null;
    if (validationLevel == ValidationLevel.NONE) {
        throw SeedException.createNew(CoreErrorCode.UNABLE_TO_CREATE_VALIDATOR_FACTORY);
    } else {
        try {
            Configuration<?> configuration = Validation.byDefaultProvider().configure();
            if (!hasXmlConfiguration && !skipAutoconfig) {
                Classes.optional("org.seedstack.seed.core.internal.validation.ReflectionParameterNameProvider")
                        .map(Classes::instantiateDefault)
                        .ifPresent(c -> configuration.parameterNameProvider((ParameterNameProvider) c));
                Classes.optional("org.seedstack.seed.core.internal.validation.HibernateMessageInterpolator")
                        .map(Classes::instantiateDefault)
                        .ifPresent(c -> configuration.messageInterpolator((MessageInterpolator) c));
            }
            if (customizer != null) {
                customizer.accept(configuration);
            }
            return configuration.buildValidatorFactory();
        } catch (Exception e) {
            throw SeedException.wrap(e, CoreErrorCode.UNABLE_TO_CREATE_VALIDATOR_FACTORY);
        }
    }
}
 
Example #2
Source File: LocalValidatorFactoryBean.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
	Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
	return this.validatorFactory.getParameterNameProvider();
}
 
Example #3
Source File: LocalValidatorFactoryBean.java    From java-technology-stack with MIT License 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
	Assert.notNull(this.validatorFactory, "No target ValidatorFactory set");
	return this.validatorFactory.getParameterNameProvider();
}
 
Example #4
Source File: SerializableValidatorFactory.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public ParameterNameProvider getParameterNameProvider()
{
   return validatorFactory.getParameterNameProvider();
}
 
Example #5
Source File: BeanValidationProvider.java    From cxf with Apache License 2.0 4 votes vote down vote up
public BeanValidationProvider(ParameterNameProvider parameterNameProvider) {
    this(new ValidationConfiguration(parameterNameProvider));
}
 
Example #6
Source File: ValidationConfiguration.java    From cxf with Apache License 2.0 4 votes vote down vote up
public ValidationConfiguration(ParameterNameProvider parameterNameProvider) {
    this.parameterNameProvider = parameterNameProvider;
}
 
Example #7
Source File: ValidationConfiguration.java    From cxf with Apache License 2.0 4 votes vote down vote up
public ParameterNameProvider getParameterNameProvider() {
    return parameterNameProvider;
}
 
Example #8
Source File: ValidationConfiguration.java    From cxf with Apache License 2.0 4 votes vote down vote up
public void setParameterNameProvider(ParameterNameProvider parameterNameProvider) {
    this.parameterNameProvider = parameterNameProvider;
}
 
Example #9
Source File: SerializableValidatorFactory.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public ParameterNameProvider getParameterNameProvider()
{
   return validatorFactory.getParameterNameProvider();
}
 
Example #10
Source File: IronJacamarValidatorFactory.java    From ironjacamar with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public ParameterNameProvider getParameterNameProvider()
{
   return validatorFactory.getParameterNameProvider();
}
 
Example #11
Source File: ValidatorFactoryWrapper.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
    return factory().getParameterNameProvider();
}
 
Example #12
Source File: SingleValidatorFactoryWrapper.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
    return factory().getParameterNameProvider();
}
 
Example #13
Source File: ValidatorBuilder.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterNameProvider getDefaultParameterNameProvider() {
    return delegate.getDefaultParameterNameProvider();
}
 
Example #14
Source File: ValidatorBuilder.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
    return delegate().getParameterNameProvider();
}
 
Example #15
Source File: CustomValidatorProvider.java    From tomee with Apache License 2.0 4 votes vote down vote up
@Override
public ParameterNameProvider getParameterNameProvider() {
    return new DefaultParameterNameProvider();
}