|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.overlord.sramp.shell.api.AbstractShellCommand
public abstract class AbstractShellCommand
Base class for shell commands.
| Constructor Summary | |
|---|---|
AbstractShellCommand()
Constructor. |
|
| Method Summary | |
|---|---|
protected Arguments |
getArguments()
Gets the command's arguments. |
protected ShellContext |
getContext()
|
protected String |
optionalArgument(int argIndex)
Returns the optional argument at the given index. |
protected String |
optionalArgument(int argIndex,
String defaultValue)
Returns the optional argument at the given index. |
void |
print(String formattedMessage,
Object... params)
Prints the given message to the output stream. |
protected String |
requiredArgument(int argIndex,
String message)
Returns the argument at the given index. |
void |
setArguments(Arguments arguments)
Sets the arguments that can be used by this command. |
void |
setContext(ShellContext context)
The shell context. |
void |
setOutput(Writer output)
Configure the command's output. |
int |
tabCompletion(String lastArgument,
List<CharSequence> candidates)
Handle tab completion for the command. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.overlord.sramp.shell.api.ShellCommand |
|---|
execute, printHelp, printUsage |
| Constructor Detail |
|---|
public AbstractShellCommand()
| Method Detail |
|---|
public void setContext(ShellContext context)
ShellCommand
setContext in interface ShellCommandorg.overlord.sramp.common.shell.ShellCommand#setContext(org.overlord.sramp.common.shell.ShellContext)protected ShellContext getContext()
public void setArguments(Arguments arguments)
ShellCommand
setArguments in interface ShellCommandorg.overlord.sramp.common.shell.ShellCommand#setArguments(java.lang.String[])protected Arguments getArguments()
protected String requiredArgument(int argIndex,
String message)
throws InvalidCommandArgumentException
argIndex - message -
InvalidCommandArgumentExceptionprotected String optionalArgument(int argIndex)
argIndex -
protected String optionalArgument(int argIndex,
String defaultValue)
argIndex - defaultValue -
public void print(String formattedMessage,
Object... params)
ShellCommand
print in interface ShellCommandorg.overlord.sramp.common.shell.ShellCommand#print(java.lang.String, java.lang.Object[])public void setOutput(Writer output)
ShellCommand
setOutput in interface ShellCommandoutput - the output to set
public int tabCompletion(String lastArgument,
List<CharSequence> candidates)
ShellCommand
tabCompletion in interface ShellCommandorg.overlord.sramp.common.shell.ShellCommand#tabCompletion(java.lang.String, java.util.List)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||