@Option(name = "messageInterpolator", type = PromptType.JAVA_CLASS) final String messageInterpolator,
@Option(name = "traversableResolver", type = PromptType.JAVA_CLASS) final String traversableResolver,
@Option(name = "constraintValidatorFactory", type = PromptType.JAVA_CLASS) final String constraintValidatorFactory)
{
// instantiates the validation provider specified by the user
final ValidationProvider provider = providerType.getValidationProvider(beanManager);
if (!project.hasFacet(ValidationFacet.class))
{
request.fire(new InstallFacets(ValidationFacet.class));
}
installDependencies(provider.getDependencies());
if (!provider.getAdditionalDependencies().isEmpty())
{
if (prompt.promptBoolean("Would you install " + providerType.getName() + " additional dependencies?", false)) {
installDependencies(provider.getAdditionalDependencies());
}
}
if (provider.getDefaultDescriptor() != null)
{
final ValidationDescriptor providerDescriptor = provider.getDefaultDescriptor();
final ValidationDescriptor descriptor = Descriptors.create(ValidationDescriptor.class)
.setDefaultProvider(providerDescriptor.getDefaultProvider())
.setMessageInterpolator( messageInterpolator == null ? providerDescriptor.getMessageInterpolator() : messageInterpolator)
.setTraversableResolver( traversableResolver == null ? providerDescriptor.getTraversableResolver() : traversableResolver)
.setConstraintValidatorFactory( constraintValidatorFactory == null ? providerDescriptor.getConstraintValidatorFactory() : constraintValidatorFactory);