本文整理了Java中javax.validation.Configuration.getDefaultTraversableResolver()
方法的一些代码示例,展示了Configuration.getDefaultTraversableResolver()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Configuration.getDefaultTraversableResolver()
方法的具体详情如下:
包路径:javax.validation.Configuration
类名称:Configuration
方法名:getDefaultTraversableResolver
[英]Returns an implementation of the TraversableResolver interface following the default TraversableResolver defined in the specification:
代码示例来源:origin: jersey/jersey
/**
* Create traversable resolver able to process {@link javax.validation.executable.ValidateOnExecution} annotation on
* beans.
*
* @param delegate resolver to be wrapped into the custom traversable resolver.
* @param handler handler to create traversable resolver for.
* @return custom traversable resolver.
*/
private ValidateOnExecutionTraversableResolver getTraversableResolver(TraversableResolver delegate,
final ValidateOnExecutionHandler handler) {
if (delegate == null) {
delegate = validationConfig.getDefaultTraversableResolver();
}
final boolean validationEnabled = validationConfig.getBootstrapConfiguration().isExecutableValidationEnabled();
final ValidateOnExecutionTraversableResolver traversableResolver = new
ValidateOnExecutionTraversableResolver(delegate, handler, validationEnabled);
return resourceContext.initResource(traversableResolver);
}
代码示例来源:origin: hibernate/hibernate-validator
private TraversableResolver createTraversableResolver(Configuration<?> config) {
BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();
String traversableResolverFqcn = bootstrapConfiguration.getTraversableResolverClassName();
if ( traversableResolverFqcn == null ) {
return config.getDefaultTraversableResolver();
}
@SuppressWarnings("unchecked")
Class<? extends TraversableResolver> traversableResolverClass = (Class<? extends TraversableResolver>) run(
LoadClass.action(
traversableResolverFqcn,
null
)
);
return createInstance( traversableResolverClass );
}
代码示例来源:origin: org.apache.tomee/openejb-core
@Override
public TraversableResolver getDefaultTraversableResolver() {
return delegate.getDefaultTraversableResolver();
}
代码示例来源:origin: org.graniteds/granite-client-java-advanced
@Override
public TraversableResolver getDefaultTraversableResolver() {
return configuration.getDefaultTraversableResolver();
}
代码示例来源:origin: org.hibernate.beanvalidation.tck/beanvalidation-tck-tests
@Test
@SpecAssertion(section = Sections.VALIDATIONAPI_BOOTSTRAPPING_CONFIGURATION, id = "b")
public void testDefaultTraversableResolverIsNotNull() {
Configuration<?> config = TestUtil.getConfigurationUnderTest();
assertNotNull( config.getDefaultTraversableResolver() );
}
代码示例来源: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.glassfish.jersey.ext/jersey-bean-validation
/**
* Create traversable resolver able to process {@link javax.validation.executable.ValidateOnExecution} annotation on
* beans.
*
* @param delegate resolver to be wrapped into the custom traversable resolver.
* @param handler handler to create traversable resolver for.
* @return custom traversable resolver.
*/
private ValidateOnExecutionTraversableResolver getTraversableResolver(TraversableResolver delegate,
final ValidateOnExecutionHandler handler) {
if (delegate == null) {
delegate = validationConfig.getDefaultTraversableResolver();
}
final boolean validationEnabled = validationConfig.getBootstrapConfiguration().isExecutableValidationEnabled();
final ValidateOnExecutionTraversableResolver traversableResolver = new
ValidateOnExecutionTraversableResolver(delegate, handler, validationEnabled);
return resourceContext.initResource(traversableResolver);
}
代码示例来源:origin: org.hibernate.validator/hibernate-validator-cdi
private TraversableResolver createTraversableResolver(Configuration<?> config) {
BootstrapConfiguration bootstrapConfiguration = config.getBootstrapConfiguration();
String traversableResolverFqcn = bootstrapConfiguration.getTraversableResolverClassName();
if ( traversableResolverFqcn == null ) {
return config.getDefaultTraversableResolver();
}
@SuppressWarnings("unchecked")
Class<? extends TraversableResolver> traversableResolverClass = (Class<? extends TraversableResolver>) run(
LoadClass.action(
traversableResolverFqcn,
null
)
);
return createInstance( traversableResolverClass );
}
内容来源于网络,如有侵权,请联系作者删除!