Search in sources :

Example 1 with PropertyFieldDefinition

use of org.sonar.api.config.PropertyFieldDefinition in project sonarqube by SonarSource.

the class SetAction method checkFieldType.

private static void checkFieldType(SetRequest request, PropertyDefinition definition, ListMultimap<String, String> valuesByFieldKeys) {
    for (PropertyFieldDefinition fieldDefinition : definition.fields()) {
        for (String value : valuesByFieldKeys.get(fieldDefinition.key())) {
            PropertyDefinition.Result result = fieldDefinition.validate(value);
            checkRequest(result.isValid(), "Error when validating setting with key '%s'. Field '%s' has incorrect value '%s'.", request.getKey(), fieldDefinition.key(), value);
        }
    }
}
Also used : PropertyFieldDefinition(org.sonar.api.config.PropertyFieldDefinition) PropertyDefinition(org.sonar.api.config.PropertyDefinition)

Aggregations

PropertyDefinition (org.sonar.api.config.PropertyDefinition)1 PropertyFieldDefinition (org.sonar.api.config.PropertyFieldDefinition)1