public interface

RepositorySettingsValidator

com.atlassian.stash.setting.RepositorySettingsValidator

Class Overview

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 RepositorySettingsValidator {
     @Override
     public void validate(Settings settings, SettingsValidationErrors errors) {
          if (settings.getString("url", "").isEmpty()) {
              errors.addFieldError("url", "Url field is blank, please supply one"));
          }
     }
 }

Summary

Public Methods
void validate(Settings settings, SettingsValidationErrors errors, Repository repository)
Validate the given settings before they are persisted.

Public Methods

public void validate (Settings settings, SettingsValidationErrors errors, Repository repository)

Validate the given settings before they are persisted.

Parameters
settings to be validated
errors callback for reporting validation errors.
repository the context Repository the settings will be associated with