public abstract class AbstractCommand
extends java.lang.Object
| Constructor and Description |
|---|
AbstractCommand() |
| Modifier and Type | Method and Description |
|---|---|
int |
getExitCode()
Gets the commands exit code
|
Shell |
getShell() |
java.lang.String |
getUsage()
Gets the command usage
|
void |
init(Shell shell)
Init command, set all needed arrtibutes from shell
|
void |
printAnswers(java.util.List<JGDIAnswer> answers)
Prints the JGDI answer list to specified PrintWriter.
|
abstract void |
run(java.lang.String[] args)
Run the command
|
protected void |
setExitCode(int newCode)
Sets the commands exit code to newCode
|
public java.lang.String getUsage()
public abstract void run(java.lang.String[] args)
throws java.lang.Exception
args - java.lang.Exceptionpublic void init(Shell shell) throws java.lang.Exception
shell - java.lang.Exceptionpublic Shell getShell()
public void printAnswers(java.util.List<JGDIAnswer> answers)
Prints the JGDI answer list to specified PrintWriter.
Helper method for JGDI methods *withAnswer
answers - a JGDI answer listpublic int getExitCode()
Gets the commands exit code
protected void setExitCode(int newCode)
Sets the commands exit code to newCode
newCode - new exitCode of this commandCopyright © 2007 Sun Microsystems, Inc. All rights reserved.