ArgumentProcessor (Apache Geode 2.0.2)
Description: declaration: package: org.apache.geode.modules.session.installer.args, class: ArgumentProcessor

Package org.apache.geode.modules.session.installer.args

# Class ArgumentProcessor

java.lang.Object
org.apache.geode.modules.session.installer.args.ArgumentProcessor

public class ArgumentProcessor extends Object
This class is used to process command line arguments for Java programs in a flexible and powerful manner.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ArgumentProcessor(String progName)`
  Creates a new Argument processor instance for te program name given.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addArgument(Argument arg)`
  Adds a new argument.
  `String`
  `getUsage()`
  Generates command line usage text for display to user.
  `ArgumentValues`
  `process(String[] programArgs)`
  Process the command line arguments provided.
  `void`
  `setUnknownArgumentHandler(UnknownArgumentHandler aHandler)`
  Sets the handler to call when an unknown argument is encountered.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ArgumentProcessor

    public ArgumentProcessor(String progName)
    Creates a new Argument processor instance for te program name given.
    Parameters:
      `progName` - program name used in usage

- ## Method Details

  - ### addArgument

    public void addArgument(Argument arg)
    Adds a new argument.
    Parameters:
      `arg` - argument to add

  - ### setUnknownArgumentHandler

    public void setUnknownArgumentHandler(UnknownArgumentHandler aHandler)
    Sets the handler to call when an unknown argument is encountered.
    Parameters:
      `aHandler` - unknown arg handler, or null to unset

  - ### process

    public ArgumentValues process(String[] programArgs) throws UsageException
    Process the command line arguments provided.
    Parameters:
      `programArgs` - command line arguments supplied to program
    Returns:
      argument values parsed out of command line
    Throws:
      `UsageException` - when usge sucked

  - ### getUsage

    public String getUsage()
    Generates command line usage text for display to user.
    Returns:
      usage to dusplay to user