Examples of messageInterpolator()


Examples of javax.validation.Configuration.messageInterpolator()

  public ValidatorFactory create(CreationalContext<ValidatorFactory> ctx) {
    Configuration config = Validation.byProvider( org.hibernate.validator.HibernateValidator.class )
        .configure();

    config.constraintValidatorFactory( createConstraintValidatorFactory( config ) );
    config.messageInterpolator( createMessageInterpolator( config ) );
    config.traversableResolver( createTraversableResolver( config ) );
    config.parameterNameProvider( createParameterNameProvider( config ) );

    return config.buildValidatorFactory();
  }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

        String group = getAndRemoveParameter(parameters, "group", String.class);
       
        Configuration configuration = Validation.byDefaultProvider().configure();
       
        if (messageInterpolator != null) {
            configuration.messageInterpolator(messageInterpolator);
        }
       
        if (traversableResolver != null) {
            configuration.traversableResolver(traversableResolver);
        }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

        String group = getAndRemoveParameter(parameters, "group", String.class);
       
        Configuration configuration = Validation.byDefaultProvider().configure();
       
        if (messageInterpolator != null) {
            configuration.messageInterpolator(messageInterpolator);
        }
       
        if (traversableResolver != null) {
            configuration.traversableResolver(traversableResolver);
        }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

    MessageInterpolator targetInterpolator = this.messageInterpolator;
    if (targetInterpolator == null) {
      targetInterpolator = configuration.getDefaultMessageInterpolator();
    }
    configuration.messageInterpolator(new LocaleContextMessageInterpolator(targetInterpolator));

    if (this.traversableResolver != null) {
      configuration.traversableResolver(this.traversableResolver);
    }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

    MessageInterpolator targetInterpolator = this.messageInterpolator;
    if (targetInterpolator == null) {
      targetInterpolator = configuration.getDefaultMessageInterpolator();
    }
    configuration.messageInterpolator(new LocaleContextMessageInterpolator(targetInterpolator));

    if (this.traversableResolver != null) {
      configuration.traversableResolver(this.traversableResolver);
    }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

  @Test
  @SpecAssertion(section = "4.3.2", id = "b")
  public void testCustomMessageInterpolatorViaConfiguration() {
    Configuration config = Validation.byDefaultProvider().configure();
    config = config.messageInterpolator( new DummyMessageInterpolator() );
    Validator validator = config.buildValidatorFactory().getValidator();

    assertCustomMessageInterpolatorUsed( validator );
  }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

  public void afterPropertiesSet() {
    Configuration configuration = (this.providerClass != null ?
        Validation.byProvider(this.providerClass).configure() :
        Validation.byDefaultProvider().configure());

    configuration.messageInterpolator(new LocaleContextMessageInterpolator(
        this.messageInterpolator, configuration.getDefaultMessageInterpolator()));

    if (this.traversableResolver != null) {
      configuration.traversableResolver(this.traversableResolver);
    }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

  @Test
  @SpecAssertion(section = "4.3.2", id = "b")
  public void testCustomMessageInterpolatorViaConfiguration() {
    Configuration config = Validation.byDefaultProvider().configure();
    config = config.messageInterpolator( new DummyMessageInterpolator() );
    Validator validator = config.buildValidatorFactory().getValidator();

    assertCustomMessageInterpolatorUsed( validator );
  }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

  @Test
  @SpecAssertion(section = "4.3.2", id = "b")
  public void testCustomMessageInterpolatorViaConfiguration() {
    Configuration config = Validation.byDefaultProvider().configure();
    config = config.messageInterpolator( new DummyMessageInterpolator() );
    Validator validator = config.buildValidatorFactory().getValidator();

    assertCustomMessageInterpolatorUsed( validator );
  }
View Full Code Here

Examples of javax.validation.Configuration.messageInterpolator()

    MessageInterpolator targetInterpolator = this.messageInterpolator;
    if (targetInterpolator == null) {
      targetInterpolator = configuration.getDefaultMessageInterpolator();
    }
    configuration.messageInterpolator(new LocaleContextMessageInterpolator(targetInterpolator));

    if (this.traversableResolver != null) {
      configuration.traversableResolver(this.traversableResolver);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.