|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jnlp.controlpanel.CommandLine
public class CommandLine
Encapsulates a command line interface to the deployment configuration.
The central method is handle(String[])
, which calls one of the
various 'handle' methods. The commands listed in allCommands
are
supported. For each supported command, a method handleCOMMANDCommand exists.
This method actually takes action based on the command. Generally, a
printCOMMANDHelp method also exists, and prints out the help message for
that specific command. For example, see handleListCommand(List)
and printListHelp()
.
Sample usage:
CommandLine cli = new CommandLine(); // the string array represents input using the command line int retVal = cli.handle(new String[] { "help" }); if (retVal == CommandLine.SUCCESS) { // good! } else { // bad! }
Field Summary | |
---|---|
static int |
ERROR
|
java.lang.String |
PROGRAM_NAME
|
static int |
SUCCESS
|
Constructor Summary | |
---|---|
CommandLine()
Creates a new instance |
Method Summary | |
---|---|
int |
handle(java.lang.String[] commandAndArgs)
Handles overall command line arguments. |
int |
handleCheckCommand(java.util.List<java.lang.String> args)
Handles the 'check' command |
int |
handleGetCommand(java.util.List<java.lang.String> args)
Handles the 'get' command. |
int |
handleHelpCommand(java.util.List<java.lang.String> args)
Handle the 'help' command |
int |
handleInfoCommand(java.util.List<java.lang.String> args)
Handles the 'info' command |
int |
handleListCommand(java.util.List<java.lang.String> args)
Handles the 'list' command |
int |
handleResetCommand(java.util.List<java.lang.String> args)
Handles the 'reset' command |
int |
handleSetCommand(java.util.List<java.lang.String> args)
Handles the 'set' command |
static void |
main(java.lang.String[] args)
The starting point of the program |
void |
printCheckHelp()
Prints a help message for the 'check' command |
void |
printGetHelp()
Prints help message for the get command |
void |
printInfoHelp()
Print a help message for the 'info' command |
void |
printListHelp()
Prints help message for the list command |
void |
printResetHelp()
Prints a help message for the reset command |
void |
printSetHelp()
Prints the help message for the 'set' command |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ERROR
public static final int SUCCESS
public final java.lang.String PROGRAM_NAME
Constructor Detail |
---|
public CommandLine()
Method Detail |
---|
public int handleHelpCommand(java.util.List<java.lang.String> args)
args
- optional
public void printListHelp()
public int handleListCommand(java.util.List<java.lang.String> args)
args
- the arguments to the list command
public void printGetHelp()
public int handleGetCommand(java.util.List<java.lang.String> args)
args
- the arguments to the get command
public void printSetHelp()
public int handleSetCommand(java.util.List<java.lang.String> args)
args
- the arguments to the set command
public void printResetHelp()
public int handleResetCommand(java.util.List<java.lang.String> args)
args
- the arguments to the reset command
public void printInfoHelp()
public int handleInfoCommand(java.util.List<java.lang.String> args)
args
- the arguments to the info command
public void printCheckHelp()
public int handleCheckCommand(java.util.List<java.lang.String> args)
args
- the arguments to the check command.
public int handle(java.lang.String[] commandAndArgs)
commandAndArgs
- A string array representing the command and
arguments to take action on
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- the command line arguments to this program
java.lang.Exception
|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |