net.sourceforge.jnlp.controlpanel

## Class CommandLine

- java.lang.Object
- - net.sourceforge.jnlp.controlpanel.CommandLine

-     public class CommandLine
      extends java.lang.Object

  Encapsulates a command line interface to the deployment configuration.

  The central method is `handle()`, which calls one of the various 'handle' methods. The commands listed in OptionsDefinitions.getItwsettingsCommands 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()` 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

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ERROR`
    `java.lang.String` | `PROGRAM_NAME`
    `static int` | `SUCCESS`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CommandLine(net.sourceforge.jnlp.util.optionparser.OptionParser optionParser)` Creates a new instance

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `handle()` Handles overall command line arguments.
    `int` | `handleCheckCommand()` Handles the 'check' command
    `int` | `handleGetCommand()` Handles the 'get' command.
    `int` | `handleHelpCommand()` Handle the 'help' command
    `int` | `handleInfoCommand()` Handles the 'info' command
    `int` | `handleListCommand()` Handles the 'list' command
    `int` | `handleResetCommand()` Handles the 'reset' command
    `int` | `handleSetCommand()` 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

    - #### ERROR

          public static final int ERROR

      See Also:
        Constant Field Values

    - #### SUCCESS

          public static final int SUCCESS

      See Also:
        Constant Field Values

    - #### PROGRAM_NAME

          public final java.lang.String PROGRAM_NAME

  - ### Constructor Detail

    - #### CommandLine

          public CommandLine(net.sourceforge.jnlp.util.optionparser.OptionParser optionParser)

      Creates a new instance
      Parameters:
        `optionParser` - used to parse applications arguments

  - ### Method Detail

    - #### handleHelpCommand

          public int handleHelpCommand()

      Handle the 'help' command
      Returns:
        the result of handling the help command. SUCCESS if no errors occurred.

    - #### printListHelp

          public void printListHelp()

      Prints help message for the list command

    - #### handleListCommand

          public int handleListCommand()

      Handles the 'list' command
      Returns:
        result of handling the command. SUCCESS if no errors occurred.

    - #### printGetHelp

          public void printGetHelp()

      Prints help message for the get command

    - #### handleGetCommand

          public int handleGetCommand()

      Handles the 'get' command.
      Returns:
        an integer representing success (SUCCESS) or error handling the get command.

    - #### printSetHelp

          public void printSetHelp()

      Prints the help message for the 'set' command

    - #### handleSetCommand

          public int handleSetCommand()

      Handles the 'set' command
      Returns:
        an integer indicating success (SUCCESS) or error in handling the command

    - #### printResetHelp

          public void printResetHelp()

      Prints a help message for the reset command

    - #### handleResetCommand

          public int handleResetCommand()

      Handles the 'reset' command
      Returns:
        an integer indicating success (SUCCESS) or error in handling the command

    - #### printInfoHelp

          public void printInfoHelp()

      Print a help message for the 'info' command

    - #### handleInfoCommand

          public int handleInfoCommand()

      Handles the 'info' command
      Returns:
        an integer indicating success (SUCCESS) or error in handling the command

    - #### printCheckHelp

          public void printCheckHelp()

      Prints a help message for the 'check' command

    - #### handleCheckCommand

          public int handleCheckCommand()

      Handles the 'check' command
      Returns:
        an integer indicating success (SUCCESS) or error in handling the command

    - #### handle

          public int handle()

      Handles overall command line arguments. The argument array is split into two pieces: the first element is assumend to be the command, and everything after is taken to be the argument to the command.
      Returns:
        an integer representing an error code or SUCCESS if no problems occurred.

    - #### main

          public static void main(java.lang.String[] args)
                           throws java.lang.Exception

      The starting point of the program
      Parameters:
        `args` - the command line arguments to this program
      Throws:
        `java.lang.Exception` - when it goes wrong

Submit a bug or feature