| com.atlassian.bitbucket.setting.SettingsValidator |
Handles validation of hook settings before they are persisted. Validation errors will be returned to the user and displayed against the relevant field.
Example:
public class MyValidator implements SettingsValidator {
@Override
public void validate(Settings settings, SettingsValidationErrors errors, Scope scope {
if (settings.getString("url", "").isEmpty()) {
errors.addFieldError("url", "Url field is blank, please supply one"));
}
}
}
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Validate the given
settings before they are persisted. | |||||||||||
Validate the given settings before they are persisted.
| settings | to be validated |
|---|---|
| errors | callback for reporting validation errors. |
| scope | the context Repository the settings will be associated with
|