|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.ow2.petals.cli.shell.command.Command
public abstract class Command
A petals CLI Command is executed inside a petals CLI shell.
| Constructor Summary | |
|---|---|
Command()
Initialize the command by inferring its name from the class name |
|
Command(Shell shell)
Create a new command |
|
| Method Summary | |
|---|---|
void |
checkArguments(java.lang.String[] args,
int min)
Check the number of arguments to be greater than a specified number |
void |
checkArguments(java.lang.String[] args,
int min,
int max)
|
abstract void |
execute(java.lang.String[] args)
|
java.lang.String |
getDescription()
Get the description of this command |
java.lang.String |
getName()
Get the name of the command from its class name |
protected Shell |
getShell()
Get the shell this command is bound to |
java.lang.String |
getUsage()
Get the usage message for this command |
protected void |
setDescription(java.lang.String description)
Set the description |
protected void |
setUsage(java.lang.String usage)
Set the usage message |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Command()
public Command(Shell shell)
shell - the shell this command will be bound to| Method Detail |
|---|
public final java.lang.String getName()
public final java.lang.String getUsage()
public final java.lang.String getDescription()
protected final Shell getShell()
protected final void setUsage(java.lang.String usage)
usage - protected final void setDescription(java.lang.String description)
description -
public void checkArguments(java.lang.String[] args,
int min)
throws CommandException
args - the array of argumentsmin - the minimal number of elements args must contain
CommandException - if args is null or contains less than min elements
public void checkArguments(java.lang.String[] args,
int min,
int max)
throws CommandException
args - min - max -
CommandException
public abstract void execute(java.lang.String[] args)
throws CommandException
CommandException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||