diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-18 11:55:56 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-12-18 13:19:09 +0100 |
commit | d1804d3f747fab4c0ead337e8b3749f13f284734 (patch) | |
tree | f018e326873a96ba44609adeee98b4202dd95788 /org.eclipse.jgit | |
parent | 5e2e111280898e47959996a1a1e016e9fcb21179 (diff) | |
download | jgit-d1804d3f747fab4c0ead337e8b3749f13f284734.tar.gz jgit-d1804d3f747fab4c0ead337e8b3749f13f284734.zip |
Fix javadoc in org.eclipse.jgit hooks package
Change-Id: I3b644048eb0fc19f94ba8f9799b5a2310481103f
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
6 files changed, 54 insertions, 7 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java index fa1707575a..f33168d814 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/CommitMsgHook.java @@ -71,6 +71,8 @@ public class CommitMsgHook extends GitHook<String> { private String commitMessage; /** + * Constructor for CommitMsgHook + * * @param repo * The repository * @param outputStream @@ -81,6 +83,7 @@ public class CommitMsgHook extends GitHook<String> { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public String call() throws IOException, AbortedByHookException { if (commitMessage == null) { @@ -103,12 +106,15 @@ public class CommitMsgHook extends GitHook<String> { return getCommitEditMessageFilePath() != null && commitMessage != null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; } /** + * {@inheritDoc} + * * This hook receives one parameter, which is the path to the file holding * the current commit-msg, relative to the repository's work tree. */ diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java index b684dd6232..fb015c9166 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/GitHook.java @@ -79,7 +79,10 @@ abstract class GitHook<T> implements Callable<T> { protected final PrintStream outputStream; /** + * Constructor for GitHook + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream the hook must use. {@code null} is allowed, * in which case the hook will use {@code System.out}. @@ -90,23 +93,23 @@ abstract class GitHook<T> implements Callable<T> { } /** + * {@inheritDoc} + * <p> * Run the hook. - * - * @throws IOException - * if IO goes wrong. - * @throws AbortedByHookException - * If the hook has been run and a returned an exit code - * different from zero. */ @Override public abstract T call() throws IOException, AbortedByHookException; /** + * Get name of the hook + * * @return The name of the hook, which must not be {@code null}. */ public abstract String getHookName(); /** + * Get the repository + * * @return The repository. */ protected Repository getRepository() { @@ -135,6 +138,8 @@ abstract class GitHook<T> implements Callable<T> { } /** + * Get output stream + * * @return The output stream the hook must use. Never {@code null}, * {@code System.out} is returned by default. */ @@ -145,7 +150,7 @@ abstract class GitHook<T> implements Callable<T> { /** * Runs the hook, without performing any validity checks. * - * @throws AbortedByHookException + * @throws org.eclipse.jgit.api.errors.AbortedByHookException * If the underlying hook script exited with non-zero. */ protected void doRun() throws AbortedByHookException { diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java index 46e8840579..87db36b251 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/Hooks.java @@ -54,7 +54,10 @@ import org.eclipse.jgit.lib.Repository; public class Hooks { /** + * Create pre-commit hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The pre-commit hook for the given repository. @@ -65,7 +68,10 @@ public class Hooks { } /** + * Create post-commit hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The post-commit hook for the given repository. @@ -77,7 +83,10 @@ public class Hooks { } /** + * Create commit-msg hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The commit-msg hook for the given repository. @@ -88,7 +97,10 @@ public class Hooks { } /** + * Create pre-push hook for the given repository + * * @param repo + * a {@link org.eclipse.jgit.lib.Repository} object. * @param outputStream * The output stream, or {@code null} to use {@code System.out} * @return The pre-push hook for the given repository. diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java index 70679e0094..24bad16ecb 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PostCommitHook.java @@ -60,6 +60,8 @@ public class PostCommitHook extends GitHook<Void> { public static final String NAME = "post-commit"; //$NON-NLS-1$ /** + * Constructor for PostCommitHook + * * @param repo * The repository * @param outputStream @@ -70,12 +72,14 @@ public class PostCommitHook extends GitHook<Void> { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public Void call() throws IOException, AbortedByHookException { doRun(); return null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java index 1ab32e0c2b..0d9290da3e 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PreCommitHook.java @@ -60,6 +60,8 @@ public class PreCommitHook extends GitHook<Void> { public static final String NAME = "pre-commit"; //$NON-NLS-1$ /** + * Constructor for PreCommitHook + * * @param repo * The repository * @param outputStream @@ -70,12 +72,14 @@ public class PreCommitHook extends GitHook<Void> { super(repo, outputStream); } + /** {@inheritDoc} */ @Override public Void call() throws IOException, AbortedByHookException { doRun(); return null; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java index a501fee901..f974eb7927 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/hooks/PrePushHook.java @@ -72,6 +72,8 @@ public class PrePushHook extends GitHook<String> { private String refs; /** + * Constructor for PrePushHook + * * @param repo * The repository * @param outputStream @@ -82,11 +84,13 @@ public class PrePushHook extends GitHook<String> { super(repo, outputStream); } + /** {@inheritDoc} */ @Override protected String getStdinArgs() { return refs; } + /** {@inheritDoc} */ @Override public String call() throws IOException, AbortedByHookException { if (canRun()) { @@ -102,12 +106,15 @@ public class PrePushHook extends GitHook<String> { return true; } + /** {@inheritDoc} */ @Override public String getHookName() { return NAME; } /** + * {@inheritDoc} + * <p> * This hook receives two parameters, which is the name and the location of * the remote repository. */ @@ -120,21 +127,30 @@ public class PrePushHook extends GitHook<String> { } /** + * Set remote name + * * @param name + * remote name */ public void setRemoteName(String name) { remoteName = name; } /** + * Set remote location + * * @param location + * a remote location */ public void setRemoteLocation(String location) { remoteLocation = location; } /** + * Set Refs + * * @param toRefs + * a collection of {@code RemoteRefUpdate}s */ public void setRefs(Collection<RemoteRefUpdate> toRefs) { StringBuilder b = new StringBuilder(); |