Class CommitWalkAction
- java.lang.Object
-
- com.github.koraktor.mavanagaiata.git.CommitWalkAction
-
- Direct Known Subclasses:
ChangelogMojo.ChangelogWalkAction,ContributorsMojo.ContributorsWalkAction
public abstract class CommitWalkAction extends Object
Basic implementation of an action that is executed for each commit during a commit walk- Author:
- Sebastian Staudt
-
-
Field Summary
Fields Modifier and Type Field Description protected GitCommitcurrentCommitprotected GitRepositoryrepository
-
Constructor Summary
Constructors Constructor Description CommitWalkAction()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidexecute(GitCommit commit)Executes this action for the given commitvoidprepare()Prepare the walk actionprotected abstract voidrun()The code of the action that should be executed for each commit during a commit walkvoidsetRepository(GitRepository repository)Sets the repository this action should be executed in
-
-
-
Field Detail
-
currentCommit
protected GitCommit currentCommit
-
repository
protected GitRepository repository
-
-
Method Detail
-
execute
public void execute(GitCommit commit) throws GitRepositoryException
Executes this action for the given commit- Parameters:
commit- The current commit- Throws:
GitRepositoryException- if an error occurs during the action
-
prepare
public void prepare() throws GitRepositoryExceptionPrepare the walk actionThis can be used to load required data for the walk action, e.g. all tags.
- Throws:
GitRepositoryException- if an error occurs during the preparation
-
run
protected abstract void run() throws GitRepositoryExceptionThe code of the action that should be executed for each commit during a commit walk- Throws:
GitRepositoryException- if an error occurs during the action
-
setRepository
public void setRepository(GitRepository repository)
Sets the repository this action should be executed in- Parameters:
repository- The repository for this action
-
-