Package com.google.gerrit.server.project
Class SubmitRequirementConfigValidator
java.lang.Object
com.google.gerrit.server.project.SubmitRequirementConfigValidator
- All Implemented Interfaces:
CommitValidationListener
Validates the expressions of submit requirements in
project.config
.
Other validation of submit requirements is done in ProjectConfig
, see
ProjectConfig#loadSubmitRequirementSections(Config)
.
The validation of the expressions cannot be in ProjectConfig
as it requires injecting
SubmitRequirementsEvaluator
and we cannot do injections into ProjectConfig
(since
ProjectConfig
is cached in the project cache).
-
Method Summary
Modifier and TypeMethodDescriptionRuns a commit validation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.google.gerrit.server.git.validators.CommitValidationListener
getValidatorName, shouldValidateAllCommits, validateCommit
-
Method Details
-
onCommitReceived
public List<CommitValidationMessage> onCommitReceived(CommitReceivedEvent event) throws CommitValidationException Description copied from interface:CommitValidationListener
Runs a commit validation.This method only exist for backwards-compatibility and doesn't need to be implemented when
CommitValidationListener.validateCommit(CommitReceivedEvent)
is implemented.- Specified by:
onCommitReceived
in interfaceCommitValidationListener
- Parameters:
event
- commit event details- Returns:
- list of validation messages if the commit passes the validation
- Throws:
CommitValidationException
- if validation fails and the commit is rejected
-