From f3560a37b832a9ae254a215267b8a2be904809dc Mon Sep 17 00:00:00 2001 From: Emmanuel Bigeon Date: Fri, 29 May 2015 16:15:46 -0400 Subject: [PATCH] Commenting --- .../fr/bigeon/gclc/CommandRequestListener.java | 3 +++ .../fr/bigeon/gclc/command/CommandParameters.java | 7 ++++++- .../bigeon/gclc/command/ParametrizedCommand.java | 10 +++++++++- .../bigeon/gclc/exception/InvalidCommandName.java | 15 +++++++++------ 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/gclc/src/main/java/fr/bigeon/gclc/CommandRequestListener.java b/gclc/src/main/java/fr/bigeon/gclc/CommandRequestListener.java index e7705d1..3a0a5be 100644 --- a/gclc/src/main/java/fr/bigeon/gclc/CommandRequestListener.java +++ b/gclc/src/main/java/fr/bigeon/gclc/CommandRequestListener.java @@ -44,5 +44,8 @@ package fr.bigeon.gclc; * * @author Emmanuel Bigeon */ public interface CommandRequestListener { + /** Indicates that the given command was requested to the application + * + * @param command the command */ void commandRequest(String command); } diff --git a/gclc/src/main/java/fr/bigeon/gclc/command/CommandParameters.java b/gclc/src/main/java/fr/bigeon/gclc/command/CommandParameters.java index 4e79e68..968c440 100644 --- a/gclc/src/main/java/fr/bigeon/gclc/command/CommandParameters.java +++ b/gclc/src/main/java/fr/bigeon/gclc/command/CommandParameters.java @@ -45,13 +45,18 @@ import java.util.List; import java.util.Set; /**

- * TODO + * An object representing a collection of parameters. It is used for defaulting + * values. * * @author Emmanuel BIGEON */ public class CommandParameters { + /** Boolean arguments */ private final HashMap boolArgs = new HashMap<>(); + /** String arguments */ private final HashMap stringArgs = new HashMap<>(); + /** Arguments restriction on the named ones */ private final boolean strict; + /** additional (unnamed) parameters */ private final List additional = new ArrayList<>(); /** @param bools the boolean parameters diff --git a/gclc/src/main/java/fr/bigeon/gclc/command/ParametrizedCommand.java b/gclc/src/main/java/fr/bigeon/gclc/command/ParametrizedCommand.java index 2bb862e..e72ed85 100644 --- a/gclc/src/main/java/fr/bigeon/gclc/command/ParametrizedCommand.java +++ b/gclc/src/main/java/fr/bigeon/gclc/command/ParametrizedCommand.java @@ -46,16 +46,24 @@ import java.util.Map; import fr.bigeon.gclc.ConsoleManager; /**

- * TODO + * A command relying on the {@link CommandParameters} to store parameters values * * @author Emmanuel BIGEON */ public abstract class ParametrizedCommand extends Command { + /** If the command may use interactive prompting for required parameters that + * were not provided on execution */ private boolean interactive = true; + /** The manager */ protected final ConsoleManager manager; + /** The boolean parameters mandatory status */ private final Map boolParams = new HashMap<>(); + /** The string parameters mandatory status */ private final Map stringParams = new HashMap<>(); + /** The parameters mandatory status */ private final Map params = new HashMap<>(); + /** The restriction of provided parameters on execution to declared paramters + * in the status maps. */ private final boolean strict; /** @param manager the manager diff --git a/gclc/src/main/java/fr/bigeon/gclc/exception/InvalidCommandName.java b/gclc/src/main/java/fr/bigeon/gclc/exception/InvalidCommandName.java index 7e4d27d..2d2cd54 100644 --- a/gclc/src/main/java/fr/bigeon/gclc/exception/InvalidCommandName.java +++ b/gclc/src/main/java/fr/bigeon/gclc/exception/InvalidCommandName.java @@ -38,13 +38,16 @@ */ package fr.bigeon.gclc.exception; -/** - *

- * TODO +/**

+ * Exception sent from the application when a command is added but the name of + * the command * - * @author Emmanuel BIGEON - * - */ + * @author Emmanuel BIGEON */ public class InvalidCommandName extends Exception { + /** + * + */ + private static final long serialVersionUID = 1L; + }