Commenting
This commit is contained in:
parent
8de80a4693
commit
f3560a37b8
@ -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);
|
||||
}
|
||||
|
@ -45,13 +45,18 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/** <p>
|
||||
* 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<String, Boolean> boolArgs = new HashMap<>();
|
||||
/** String arguments */
|
||||
private final HashMap<String, String> stringArgs = new HashMap<>();
|
||||
/** Arguments restriction on the named ones */
|
||||
private final boolean strict;
|
||||
/** additional (unnamed) parameters */
|
||||
private final List<String> additional = new ArrayList<>();
|
||||
|
||||
/** @param bools the boolean parameters
|
||||
|
@ -46,16 +46,24 @@ import java.util.Map;
|
||||
import fr.bigeon.gclc.ConsoleManager;
|
||||
|
||||
/** <p>
|
||||
* 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<String, Boolean> boolParams = new HashMap<>();
|
||||
/** The string parameters mandatory status */
|
||||
private final Map<String, Boolean> stringParams = new HashMap<>();
|
||||
/** The parameters mandatory status */
|
||||
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;
|
||||
|
||||
/** @param manager the manager
|
||||
|
@ -38,13 +38,16 @@
|
||||
*/
|
||||
package fr.bigeon.gclc.exception;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* TODO
|
||||
/** <p>
|
||||
* 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;
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user