use of org.sonar.api.server.rule.RuleParamType in project sonarqube by SonarSource.
the class RuleCreator method validateParam.
private void validateParam(RuleParamDto ruleParam, @Nullable String value) {
if (value != null) {
RuleParamType ruleParamType = RuleParamType.parse(ruleParam.getType());
if (ruleParamType.multiple()) {
List<String> values = newArrayList(Splitter.on(",").split(value));
typeValidations.validate(values, ruleParamType.type(), ruleParamType.values());
} else {
typeValidations.validate(value, ruleParamType.type(), ruleParamType.values());
}
}
}
use of org.sonar.api.server.rule.RuleParamType in project sonarqube by SonarSource.
the class RuleActivator method validateParam.
@CheckForNull
private String validateParam(RuleParamDto ruleParam, @Nullable String value) {
if (value != null) {
RuleParamType ruleParamType = RuleParamType.parse(ruleParam.getType());
if (ruleParamType.multiple()) {
List<String> values = newArrayList(Splitter.on(",").split(value));
typeValidations.validate(values, ruleParamType.type(), ruleParamType.values());
} else {
typeValidations.validate(value, ruleParamType.type(), ruleParamType.values());
}
}
return value;
}
use of org.sonar.api.server.rule.RuleParamType in project sonarqube by SonarSource.
the class RuleActivator method validateParam.
@CheckForNull
private String validateParam(RuleParamDto ruleParam, @Nullable String value) {
if (value != null) {
RuleParamType ruleParamType = RuleParamType.parse(ruleParam.getType());
if (ruleParamType.multiple()) {
List<String> values = Splitter.on(",").splitToList(value);
typeValidations.validate(values, ruleParamType.type(), ruleParamType.values());
} else {
typeValidations.validate(value, ruleParamType.type(), ruleParamType.values());
}
}
return value;
}
use of org.sonar.api.server.rule.RuleParamType in project sonarqube by SonarSource.
the class BuiltInQProfileInsertImpl method validateParam.
private String validateParam(RuleParamDto ruleParam, String value) {
RuleParamType ruleParamType = RuleParamType.parse(ruleParam.getType());
if (ruleParamType.multiple()) {
List<String> values = newArrayList(Splitter.on(",").split(value));
typeValidations.validate(values, ruleParamType.type(), ruleParamType.values());
} else {
typeValidations.validate(value, ruleParamType.type(), ruleParamType.values());
}
return value;
}
Aggregations