Package javax.validation

Examples of javax.validation.Configuration.buildValidatorFactory()


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

    return config.buildValidatorFactory();
  }

  @Override
  public void destroy(ValidatorFactory instance, CreationalContext<ValidatorFactory> ctx) {
    for ( DestructibleBeanInstance<?> resource : destructibleResources ) {
View Full Code Here


       
        if (constraintValidatorFactory != null) {
            configuration.constraintValidatorFactory(constraintValidatorFactory);           
        }
       
        ValidatorFactory validatorFactory = configuration.buildValidatorFactory();
        beanValidator.setValidatorFactory(validatorFactory);
       
        if (group != null) {
            beanValidator.setGroup(getCamelContext().getClassResolver().resolveMandatoryClass(group));
        }
View Full Code Here

       
        if (constraintValidatorFactory != null) {
            configuration.constraintValidatorFactory(constraintValidatorFactory);           
        }
       
        ValidatorFactory validatorFactory = configuration.buildValidatorFactory();
        beanValidator.setValidatorFactory(validatorFactory);
       
        if (group != null) {
            beanValidator.setGroup(getCamelContext().getClassResolver().resolveMandatoryClass(group));
        }
View Full Code Here

    for (Map.Entry<String, String> entry : this.validationPropertyMap.entrySet()) {
      configuration.addProperty(entry.getKey(), entry.getValue());
    }

    this.validatorFactory = configuration.buildValidatorFactory();
    setTargetValidator(this.validatorFactory.getValidator());
  }


  public Validator getValidator() {
View Full Code Here

    for (Map.Entry<String, String> entry : this.validationPropertyMap.entrySet()) {
      configuration.addProperty(entry.getKey(), entry.getValue());
    }

    this.validatorFactory = configuration.buildValidatorFactory();
    setTargetValidator(this.validatorFactory.getValidator());
  }


  public Validator getValidator() {
View Full Code Here

  @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 );
  }

  @Test
View Full Code Here

    for (Map.Entry<String, String> entry : this.validationPropertyMap.entrySet()) {
      configuration.addProperty(entry.getKey(), entry.getValue());
    }

    this.validatorFactory = configuration.buildValidatorFactory();
    setTargetValidator(this.validatorFactory.getValidator());
  }


  public Validator getValidator() {
View Full Code Here

  @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 );
  }

  @Test
View Full Code Here

  @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 );
  }

  @Test
View Full Code Here

    for (Map.Entry<String, String> entry : this.validationPropertyMap.entrySet()) {
      configuration.addProperty(entry.getKey(), entry.getValue());
    }

    this.validatorFactory = configuration.buildValidatorFactory();
    setTargetValidator(this.validatorFactory.getValidator());
  }


  public Validator getValidator() {
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.