Package com.atlassian.bitbucket.setting
Interface SettingsValidator
public interface 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")); } } }
- Since:
- 5.2
-
Method Summary
Modifier and TypeMethodDescriptionvoid
validate
(com.atlassian.bitbucket.setting.Settings settings, SettingsValidationErrors errors, com.atlassian.bitbucket.scope.Scope scope) Validate the givensettings
before they are persisted.
-
Method Details
-
validate
void validate(@Nonnull com.atlassian.bitbucket.setting.Settings settings, @Nonnull SettingsValidationErrors errors, @Nonnull com.atlassian.bitbucket.scope.Scope scope) Validate the givensettings
before they are persisted.- Parameters:
settings
- to be validatederrors
- callback for reporting validation errors.scope
- the contextRepository
the settings will be associated with
-