本文整理了Java中javax.validation.Configuration.getDefaultClockProvider()
方法的一些代码示例,展示了Configuration.getDefaultClockProvider()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getDefaultClockProvider()
方法的具体详情如下:
包路径:javax.validation.Configuration
类名称:Configuration
方法名:getDefaultClockProvider
[英]Returns an implementation of the ClockProviderinterface following the default ClockProviderdefined in the specification:
代码示例来源:origin: hibernate/hibernate-validator
private ClockProvider createClockProvider(Configuration<?> config) {
BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();
String clockProviderFqcn = bootstrapConfiguration.getClockProviderClassName();
if ( clockProviderFqcn == null ) {
return config.getDefaultClockProvider();
}
@SuppressWarnings("unchecked")
Class<? extends ClockProvider> clockProviderClass = (Class<? extends ClockProvider>) run(
LoadClass.action(
clockProviderFqcn,
null
)
);
return createInstance( clockProviderClass );
}
代码示例来源:origin: org.hibernate.beanvalidation.tck/beanvalidation-tck-tests
@Test
@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_CONFIGURATION, id = "e")
public void testDefaultClockProviderProvidedByConfiguration() {
Configuration<?> config = TestUtil.getConfigurationUnderTest();
assertNotNull( config.getDefaultClockProvider() );
checkClockProviderHasDefaultProperties( config.getDefaultClockProvider() );
}
代码示例来源:origin: org.hibernate.validator/hibernate-validator-cdi
private ClockProvider createClockProvider(Configuration<?> config) {
BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();
String clockProviderFqcn = bootstrapConfiguration.getClockProviderClassName();
if ( clockProviderFqcn == null ) {
return config.getDefaultClockProvider();
}
@SuppressWarnings("unchecked")
Class<? extends ClockProvider> clockProviderClass = (Class<? extends ClockProvider>) run(
LoadClass.action(
clockProviderFqcn,
null
)
);
return createInstance( clockProviderClass );
}
内容来源于网络,如有侵权,请联系作者删除!