All Packages This Package Class Hierarchy Class Search Index
java.lang.Object | +----kh.util.OptionsParse
Summary |
public class OptionsParse extends java.lang.Object { // Constructors 2 public OptionsParse(); public OptionsParse(Properties); // Methods 3 public void addBooleanOption(String, String); public Properties getProperties(); public String[] parse(String[]) throws BadOptionException; }
This class is a generalized commandline options parser. You can use this class to easily convert command line options into properties.
Constructors |
· OptionsParse | Summary | Top |
public OptionsParse()
This constructor allows you to just parse options, without providing an initial set of properties.
· OptionsParse | Summary | Top |
public OptionsParse(Properties props)
Use this constructor when you'd like to build on a preexisting set of properties.
Methods |
· addBooleanOption | Summary | Top |
public void addBooleanOption(String optionWord, String propertyName)
Adds a mapping from the specified option letter to a property name. If the command line contains the specified option, then the property will be defined with the value of "true." Otherwise, the property will not be defined.
Parameter Description optionWord The option letter, example: "r" propertyName The property to define, example: "recursive"
· getProperties | Summary | Top |
public Properties getProperties()
Get the generated properties
· parse | Summary | Top |
public String[] parse(String[] args) throws BadOptionException
Parse a commandline - extracting any options and returning all non option arguments. The parsed options are then accessible by calling getOptions().
All Packages This Package Class Hierarchy Class Search IndexFreshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7