From a0da423a7b8a45a5ca10912cdc568dcdfc1766a3 Mon Sep 17 00:00:00 2001 From: ljacqu Date: Thu, 31 Dec 2015 13:32:41 +0100 Subject: [PATCH] Minor - Javadoc changes - Add/replace/improve javadoc in the commands and encryption section - Note: A simple

is the javadoc way to make a new paragraph http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#format - Note: Do not escape '<' and '>' inside of {@code } - Note: '>' does not need to be escaped --- .../authme/command/CommandDescription.java | 16 +++++++------ .../xephi/authme/command/CommandHandler.java | 7 +++--- .../xephi/authme/command/CommandService.java | 23 +++++++++++-------- .../authme/command/FoundCommandResult.java | 3 +-- .../xephi/authme/command/PlayerCommand.java | 2 +- .../crypts/description/AsciiRestricted.java | 2 +- .../security/crypts/description/HasSalt.java | 12 ++++++---- .../crypts/description/Recommendation.java | 10 +++++--- .../security/crypts/description/SaltType.java | 2 +- .../security/crypts/description/Usage.java | 6 +++++ .../crypts/AbstractEncryptionMethodTest.java | 18 +++++++++++++-- 11 files changed, 67 insertions(+), 34 deletions(-) diff --git a/src/main/java/fr/xephi/authme/command/CommandDescription.java b/src/main/java/fr/xephi/authme/command/CommandDescription.java index d398af67..22a3f05c 100644 --- a/src/main/java/fr/xephi/authme/command/CommandDescription.java +++ b/src/main/java/fr/xephi/authme/command/CommandDescription.java @@ -12,12 +12,13 @@ import static com.google.common.base.Preconditions.checkArgument; import static java.util.Arrays.asList; /** - * Command description - defines which labels ("names") will lead to a command and points to the + * Command description – defines which labels ("names") will lead to a command and points to the * {@link ExecutableCommand} implementation that executes the logic of the command. * - * CommandDescription instances are built hierarchically and have one parent or {@code null} for base commands - * (main commands such as /authme) and may have multiple children extending the mapping of the parent: e.g. if - * /authme has a child whose label is "register", then "/authme register" is the command that the child defines. + * CommandDescription instances are built hierarchically: they have one parent, or {@code null} for base commands + * (main commands such as {@code /authme}), and may have multiple children extending the mapping of the parent: e.g. if + * {@code /authme} has a child whose label is {@code "register"}, then {@code /authme register} is the command that + * the child defines. */ public class CommandDescription { @@ -102,10 +103,11 @@ public class CommandDescription { } /** - * Get all relative labels of this command. For example, if this object describes "/authme register" and - * "/authme r", then "r" and "register" are the relative labels, whereas "authme" is the label of the parent. + * Return all relative labels of this command. For example, if this object describes {@code /authme register} and + * {@code /authme r}, then it will return a list with {@code register} and {@code r}. The parent label + * {@code authme} is not returned. * - * @return All relative labels. + * @return All labels of the command description. */ public List getLabels() { return labels; diff --git a/src/main/java/fr/xephi/authme/command/CommandHandler.java b/src/main/java/fr/xephi/authme/command/CommandHandler.java index 3d6d3d24..e3ab671b 100644 --- a/src/main/java/fr/xephi/authme/command/CommandHandler.java +++ b/src/main/java/fr/xephi/authme/command/CommandHandler.java @@ -49,9 +49,10 @@ public class CommandHandler { } /** - * - * @param sender - * @param result + * Execute the command for the given command sender. + * + * @param sender The sender which initiated the command + * @param result The mapped result */ private void executeCommand(CommandSender sender, FoundCommandResult result) { ExecutableCommand executableCommand = result.getCommandDescription().getExecutableCommand(); diff --git a/src/main/java/fr/xephi/authme/command/CommandService.java b/src/main/java/fr/xephi/authme/command/CommandService.java index f8b7f852..08a2790e 100644 --- a/src/main/java/fr/xephi/authme/command/CommandService.java +++ b/src/main/java/fr/xephi/authme/command/CommandService.java @@ -54,10 +54,11 @@ public class CommandService { } /** - * - * @param sender CommandSender - * @param messageKey MessageKey - * @param replacements String... + * Send a message to a player. + * + * @param sender The command sender to send the message to + * @param messageKey The message key to send + * @param replacements The replacement arguments for the message key's tags */ public void send(CommandSender sender, MessageKey messageKey, String... replacements) { messages.send(sender, messageKey, replacements); @@ -127,7 +128,7 @@ public class CommandService { } /** - * Returns the management instance of the plugin. + * Return the management instance of the plugin. * * @return The Management instance linked to the AuthMe instance */ @@ -136,8 +137,9 @@ public class CommandService { } /** - * - * @return PermissionManager the PermissionManager + * Return the permissions manager. + * + * @return the permissions manager */ public PermissionsManager getPermissionsManager() { // TODO ljacqu 20151226: Might be nicer to pass the perm manager via constructor @@ -145,9 +147,10 @@ public class CommandService { } /** - * - * @param key MessageKey - * @return StringArray Array of String + * Retrieve a message by its message key. + * + * @param key The message to retrieve + * @return The message */ public String[] retrieveMessage(MessageKey key) { return messages.retrieve(key); diff --git a/src/main/java/fr/xephi/authme/command/FoundCommandResult.java b/src/main/java/fr/xephi/authme/command/FoundCommandResult.java index 7f19a4f0..520eec24 100644 --- a/src/main/java/fr/xephi/authme/command/FoundCommandResult.java +++ b/src/main/java/fr/xephi/authme/command/FoundCommandResult.java @@ -3,10 +3,9 @@ package fr.xephi.authme.command; import java.util.List; /** - *

* Result of a command mapping by {@link CommandHandler}. An object of this class represents a successful mapping * as well as erroneous ones, as communicated with {@link FoundResultStatus}. - *

+ *

* Fields other than {@link FoundResultStatus} are available depending, among other factors, on the status: *