|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnl.toolforge.karma.core.cmd.DefaultCommand
Default stuff for a command. Provides the datastructure and some helper methods to implementing commands.
| Constructor Summary | |
DefaultCommand(CommandDescriptor descriptor)
Creates a command by initializing the command through its CommandDescriptor. |
|
| Method Summary | |
void |
cleanUp()
Override to clean up stuff. |
void |
deregisterCommandResponseListener(CommandResponseListener responseListener)
Deregister the CommandResponseListener. |
java.lang.String |
getAlias()
Gets a command's alias; the shortcut name for the command. |
org.apache.commons.cli.CommandLine |
getCommandLine()
Gets the parsed command line for this command. |
CommandContext |
getContext()
Accessor method for the commands' CommandContext. |
java.lang.String |
getDescription()
Gets a localized version of a command's description. |
protected java.util.ResourceBundle |
getFrontendMessages()
Helper method to get a resource bundle for frontend messages for commands. |
java.lang.String |
getHelp()
A commands help text. |
java.lang.String |
getName()
Gets a command's name. |
CommandResponseListener |
getResponseListener()
Gets the response listener object for this command. |
WorkingContext |
getWorkingContext()
Helper to get the current WorkingContext. |
void |
registerCommandResponseListener(CommandResponseListener responseListener)
Register the given CommandResponseListener as the handler for the command responses. |
void |
setCommandLine(org.apache.commons.cli.CommandLine commandLine)
|
void |
setContext(CommandContext contextRef)
Sets the command context for this command. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nl.toolforge.karma.core.cmd.Command |
execute, getCommandResponse |
| Constructor Detail |
public DefaultCommand(CommandDescriptor descriptor)
CommandDescriptor.
descriptor - The command descriptor instance containing the basic information for this command| Method Detail |
public final void setContext(CommandContext contextRef)
setContext in interface CommandcontextRef - The CommandContext for this command.public final java.lang.String getName()
getName in interface CommandString.public final java.lang.String getAlias()
getAlias in interface CommandString.public final WorkingContext getWorkingContext()
WorkingContext.
WorkingContext.public final java.lang.String getDescription()
getDescription in interface CommandString.public final void setCommandLine(org.apache.commons.cli.CommandLine commandLine)
setCommandLine in interface Commandpublic final org.apache.commons.cli.CommandLine getCommandLine()
getCommandLine in interface Commandpublic final void registerCommandResponseListener(CommandResponseListener responseListener)
CommandCommandResponseListener as the handler for the command responses.
registerCommandResponseListener in interface CommandresponseListener - public final void deregisterCommandResponseListener(CommandResponseListener responseListener)
CommandCommandResponseListener.
deregisterCommandResponseListener in interface Commandpublic final CommandResponseListener getResponseListener()
public final CommandContext getContext()
CommandContext.
public java.lang.String getHelp()
<help>-element.
getHelp in interface Commandprotected final java.util.ResourceBundle getFrontendMessages()
ResourceBundle for the current locale for frontend messages.public void cleanUp()
cleanUp in interface Command
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||