javax.validation.Configuration.getDefaultConstraintValidatorFactory()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(145)

本文整理了Java中javax.validation.Configuration.getDefaultConstraintValidatorFactory()方法的一些代码示例,展示了Configuration.getDefaultConstraintValidatorFactory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getDefaultConstraintValidatorFactory()方法的具体详情如下:
包路径:javax.validation.Configuration
类名称:Configuration
方法名:getDefaultConstraintValidatorFactory

Configuration.getDefaultConstraintValidatorFactory介绍

[英]Returns an implementation of the ConstraintValidatorFactory interface following the default ConstraintValidatorFactory defined in the specification:

  • uses the public no-arg constructor of the ConstraintValidator
    [中]按照规范中定义的默认ConstraintValidatorFactory返回ConstraintValidatorFactory接口的实现:
    *使用ConstraintValidator的公共无参数构造函数

代码示例

代码示例来源:origin: org.apache.tomee/openejb-core

@Override
public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
  return delegate.getDefaultConstraintValidatorFactory();
}

代码示例来源:origin: org.graniteds/granite-client-java-advanced

@Override
public ConstraintValidatorFactory getDefaultConstraintValidatorFactory() {
  return configuration.getDefaultConstraintValidatorFactory();
}

代码示例来源:origin: org.apache.deltaspike.modules/deltaspike-bean-validation-module-impl

public CDIAwareConstraintValidatorFactory()
{
  delegate = Validation.byDefaultProvider().configure().getDefaultConstraintValidatorFactory();
  if (log.isLoggable(Level.CONFIG))
  {
    log.config("Setting up delegate ConstraintValidatorFactory as " + 
        delegate.getClass().getCanonicalName());
  }
}

代码示例来源:origin: apache/deltaspike

public CDIAwareConstraintValidatorFactory()
{
  delegate = Validation.byDefaultProvider().configure().getDefaultConstraintValidatorFactory();
  if (log.isLoggable(Level.CONFIG))
  {
    log.config("Setting up delegate ConstraintValidatorFactory as " + 
        delegate.getClass().getCanonicalName());
  }
}

代码示例来源:origin: com.googlecode.gwt-validation/gwt-validation

public void setConfiguration(Configuration<?> configuration) {
  if(configuration == null) return;
  this.configuration = configuration;
  this.resolver = this.configuration.getDefaultTraversableResolver();
  this.interpolator = this.configuration.getDefaultMessageInterpolator();
  this.constraintValidatorFactory = this.configuration.getDefaultConstraintValidatorFactory();
}

代码示例来源:origin: org.hibernate.beanvalidation.tck/beanvalidation-tck-tests

@Test
@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_CONFIGURATION, id = "c")
public void testDefaultConstructorInValidatorCalled() {
  ConstraintValidatorFactory factory = TestUtil.getConfigurationUnderTest()
      .getDefaultConstraintValidatorFactory();
  factory.getInstance( MyConstraintValidator.class );
  assertTrue(
      MyConstraintValidator.defaultConstructorCalled,
      "The no-arg default constructor should have been called."
  );
}

代码示例来源:origin: org.jboss.seam.validation/seam-validation

public InjectingConstraintValidatorFactory() {
  delegate = Validation.byDefaultProvider().configure().getDefaultConstraintValidatorFactory();
}

代码示例来源:origin: org.hibernate.beanvalidation.tck/beanvalidation-tck-tests

@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_CONFIGURATION, id = "c")
  @Test(expectedExceptions = ValidationException.class)
  public void testRuntimeExceptionInValidatorCreationIsWrapped() {
    ConstraintValidatorFactory factory = TestUtil.getConfigurationUnderTest()
        .getDefaultConstraintValidatorFactory();
    factory.getInstance( MySecondConstraintValidator.class );
  }
}

相关文章