|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.javatest.tool.Command
public abstract class Command
A class to represent a command to be executed. Commands are typically read from the command line or from command files.
Nested Class Summary | |
---|---|
class |
Command.Fault
This exception is used to report problems with a specific command. |
Field Summary | |
---|---|
static int |
DEFAULT_DTMODE
A value to indicate that a command accepts the default desktop mode. |
static int |
DESKTOP_NOT_REQUIRED_DTMODE
A value to indicate that a command does not require the use of a desktop to function. |
static int |
DESKTOP_REQUIRED_DTMODE
A value to indicate that a command requires the use of a desktop to function. |
Constructor Summary | |
---|---|
protected |
Command(java.lang.String name)
Create an instance of a command. |
Method Summary | |
---|---|
protected void |
addArg(java.lang.String arg)
Record another argument in the argument array. |
java.lang.String[] |
getArgs()
Get the array of arguments for this command. |
protected InterviewParameters |
getConfig(CommandContext ctx)
A convenience method to get the configuration from a command context, and rewrapping any exception that might occur. |
java.net.URL |
getCustomSplash()
Get the classpath to load the custom splash screen from. |
int |
getDesktopMode()
Get the desktop mode for this command. |
boolean |
isActionCommand()
Check whether this command is an action command or not. |
protected java.lang.String |
nextArg(java.util.Iterator argIter)
Get another argument from the iterator, and add it to the argument array. |
protected void |
putbackArg(java.util.ListIterator argIter)
Back up the iterator to reject an argument, and remove the corresponding entry from the argument array. |
abstract void |
run(CommandContext ctx)
Execute the work embodied by this command, using the given command context. |
java.lang.String |
toString()
Get a printable representation of this command. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_DTMODE
getDesktopMode()
,
DESKTOP_NOT_REQUIRED_DTMODE
,
DESKTOP_REQUIRED_DTMODE
,
Constant Field Valuespublic static final int DESKTOP_NOT_REQUIRED_DTMODE
getDesktopMode()
,
DEFAULT_DTMODE
,
DESKTOP_REQUIRED_DTMODE
,
Constant Field Valuespublic static final int DESKTOP_REQUIRED_DTMODE
getDesktopMode()
,
DEFAULT_DTMODE
,
DESKTOP_NOT_REQUIRED_DTMODE
,
Constant Field ValuesConstructor Detail |
---|
protected Command(java.lang.String name)
name
- The name for this command.
The name will be saved as the first entry as the argument array.Method Detail |
---|
protected void addArg(java.lang.String arg)
arg
- the argument to be addedprotected java.lang.String nextArg(java.util.Iterator argIter)
argIter
- the iterator from which to get the next argument
protected void putbackArg(java.util.ListIterator argIter)
argIter
- the iterator from which teh argument was obtainedpublic java.lang.String[] getArgs()
public java.lang.String toString()
toString
in class java.lang.Object
public int getDesktopMode()
DEFAULT_DTMODE
,
DESKTOP_NOT_REQUIRED_DTMODE
,
DESKTOP_REQUIRED_DTMODE
public java.net.URL getCustomSplash()
startup.icon
.
ResourceBundle
public boolean isActionCommand()
public abstract void run(CommandContext ctx) throws Command.Fault
ctx
- context information that may be set up by preceding commands.
Command.Fault
- if there is an error while executing this commandprotected InterviewParameters getConfig(CommandContext ctx) throws Command.Fault
ctx
- the command context from which to get the configuration
Command.Fault
- if there is a problem obtaining or evaluating
the configuration.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |