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 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