| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.cli.PatternOptionBuilder
Allows Options to be created from a single String. The pattern contains various single character flags and via an optional punctuation character, their expected type.
| a | -a flag | 
| b@ | -b [classname] | 
| c> | -c [filename] | 
| d+ | -d [classname] (creates object via empty contructor) | 
| e% | -e [number] (creates Double/Long instance depeding on existing of a '.') | 
| f/ | -f [url] | 
| g: | -g [string] | 
For example, the following allows command line flags of '-v -p string-value -f /dir/file'.
Options options = PatternOptionBuilder.parsePattern("vp:f/");
 TODO These need to break out to OptionType and also to be pluggable.
| Field Summary | |
| static Class | CLASS_VALUEClass class | 
| static Class | DATE_VALUEDate class | 
| static Class | EXISTING_FILE_VALUEFileInputStream class | 
| static Class | FILE_VALUEFile class | 
| static Class | FILES_VALUEFile array class | 
| static Class | NUMBER_VALUENumber class | 
| static Class | OBJECT_VALUEObject class | 
| static Class | STRING_VALUEString class | 
| static Class | URL_VALUEURL class | 
| Constructor Summary | |
| PatternOptionBuilder() | |
| Method Summary | |
| static Object | getValueClass(char ch)Retrieve the class that chrepresents. | 
| static boolean | isValueCode(char ch)Returns whether chis a value code, i.e. | 
| static Options | parsePattern(String pattern)Returns the Optionsinstance represented bypattern. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
public static final Class STRING_VALUE
public static final Class OBJECT_VALUE
public static final Class NUMBER_VALUE
public static final Class DATE_VALUE
public static final Class CLASS_VALUE
public static final Class EXISTING_FILE_VALUE
public static final Class FILE_VALUE
public static final Class FILES_VALUE
public static final Class URL_VALUE
| Constructor Detail | 
public PatternOptionBuilder()
| Method Detail | 
public static Object getValueClass(char ch)
Retrieve the class that ch represents.
ch - the specified character
ch representspublic static boolean isValueCode(char ch)
Returns whether ch is a value code, i.e.
 whether it represents a class in a pattern.
ch - the specified character
ch is a value code, otherwise false.public static Options parsePattern(String pattern)
Returns the Options instance represented by 
 pattern.
pattern - the pattern string
Options instance| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||