use of org.apache.openejb.jee.bval.DefaultValidatedExecutableTypesType in project tomee by apache.
the class ValidatorBuilder method getInfo.
public static ValidationInfo getInfo(final ValidationConfigType config) {
final ValidationInfo info = new ValidationInfo();
if (config != null) {
info.version = config.getVersion();
info.providerClassName = config.getDefaultProvider();
info.constraintFactoryClass = config.getConstraintValidatorFactory();
info.traversableResolverClass = config.getTraversableResolver();
info.messageInterpolatorClass = config.getMessageInterpolator();
info.parameterNameProviderClass = config.getParameterNameProvider();
final ExecutableValidationType executableValidation = config.getExecutableValidation();
if (executableValidation != null) {
info.executableValidationEnabled = executableValidation.getEnabled();
final DefaultValidatedExecutableTypesType executableTypes = executableValidation.getDefaultValidatedExecutableTypes();
if (executableTypes != null) {
for (final ExecutableType type : executableTypes.getExecutableType()) {
info.validatedTypes.add(type.name());
}
}
}
for (final PropertyType p : config.getProperty()) {
info.propertyTypes.put(p.getName(), p.getValue());
}
for (final String element : config.getConstraintMapping()) {
info.constraintMappings.add(element);
}
}
return info;
}
Aggregations