Commenting

This commit is contained in:
Emmanuel Bigeon 2015-05-29 16:15:46 -04:00
parent 8de80a4693
commit f3560a37b8
4 changed files with 27 additions and 8 deletions

View File

@ -44,5 +44,8 @@ package fr.bigeon.gclc;
* *
* @author Emmanuel Bigeon */ * @author Emmanuel Bigeon */
public interface CommandRequestListener { public interface CommandRequestListener {
/** Indicates that the given command was requested to the application
*
* @param command the command */
void commandRequest(String command); void commandRequest(String command);
} }

View File

@ -45,13 +45,18 @@ import java.util.List;
import java.util.Set; import java.util.Set;
/** <p> /** <p>
* TODO * An object representing a collection of parameters. It is used for defaulting
* values.
* *
* @author Emmanuel BIGEON */ * @author Emmanuel BIGEON */
public class CommandParameters { public class CommandParameters {
/** Boolean arguments */
private final HashMap<String, Boolean> boolArgs = new HashMap<>(); private final HashMap<String, Boolean> boolArgs = new HashMap<>();
/** String arguments */
private final HashMap<String, String> stringArgs = new HashMap<>(); private final HashMap<String, String> stringArgs = new HashMap<>();
/** Arguments restriction on the named ones */
private final boolean strict; private final boolean strict;
/** additional (unnamed) parameters */
private final List<String> additional = new ArrayList<>(); private final List<String> additional = new ArrayList<>();
/** @param bools the boolean parameters /** @param bools the boolean parameters

View File

@ -46,16 +46,24 @@ import java.util.Map;
import fr.bigeon.gclc.ConsoleManager; import fr.bigeon.gclc.ConsoleManager;
/** <p> /** <p>
* TODO * A command relying on the {@link CommandParameters} to store parameters values
* *
* @author Emmanuel BIGEON */ * @author Emmanuel BIGEON */
public abstract class ParametrizedCommand extends Command { 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; private boolean interactive = true;
/** The manager */
protected final ConsoleManager manager; protected final ConsoleManager manager;
/** The boolean parameters mandatory status */
private final Map<String, Boolean> boolParams = new HashMap<>(); private final Map<String, Boolean> boolParams = new HashMap<>();
/** The string parameters mandatory status */
private final Map<String, Boolean> stringParams = new HashMap<>(); private final Map<String, Boolean> stringParams = new HashMap<>();
/** The parameters mandatory status */
private final Map<String, Boolean> params = new HashMap<>(); private final Map<String, Boolean> params = new HashMap<>();
/** The restriction of provided parameters on execution to declared paramters
* in the status maps. */
private final boolean strict; private final boolean strict;
/** @param manager the manager /** @param manager the manager

View File

@ -38,13 +38,16 @@
*/ */
package fr.bigeon.gclc.exception; package fr.bigeon.gclc.exception;
/** /** <p>
* <p> * Exception sent from the application when a command is added but the name of
* TODO * the command
* *
* @author Emmanuel BIGEON * @author Emmanuel BIGEON */
*
*/
public class InvalidCommandName extends Exception { public class InvalidCommandName extends Exception {
/**
*
*/
private static final long serialVersionUID = 1L;
} }