|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.jargp.ArgumentProcessor
Command line parameter processing handler. Organizes all the parameter information, including the data object to which parameter values defined by the command line are stored. Provides specialized processing for the argument strings, including recognizing the '-' character at the start of an argument as indicating that the argument provides control information (flags and possibly embedded values) as opposed to data.
Constructor Summary | |
ArgumentProcessor(ParameterDef[] defs)
Constructor from array of parameter definitions. |
|
ArgumentProcessor(ParameterSet set)
Constructor from parameter set definition. |
Method Summary | |
StringTracker |
getArgs()
Get argument list information. |
void |
listParameters(int width,
java.io.PrintStream print)
List known parameter definitions. |
java.lang.Object |
processArgs(java.lang.String[] args,
java.lang.Object target)
Process argument list control information. |
static int |
processArgs(java.lang.String[] args,
ParameterDef[] parms,
java.lang.Object target)
Process argument list directly. |
void |
reportArgumentError(char flag,
java.lang.String text)
Report argument error. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ArgumentProcessor(ParameterSet set)
set
- head parameter set in possible chain of sets definedpublic ArgumentProcessor(ParameterDef[] defs)
Method Detail |
public java.lang.Object processArgs(java.lang.String[] args, java.lang.Object target)
args
- command line argument string arraytarget
- application object defining parameter fields
ArgumentErrorException
- on error in data
java.lang.IllegalArgumentException
- on error in processingpublic StringTracker getArgs()
public void reportArgumentError(char flag, java.lang.String text)
flag
- argument flag charactertext
- error message text
ArgumentErrorException
- reporting the errorpublic void listParameters(int width, java.io.PrintStream print)
width
- maximum number of columns in listingprint
- print stream destination for listing definitionspublic static int processArgs(java.lang.String[] args, ParameterDef[] parms, java.lang.Object target)
args
- command line argument string arraytarget
- application object defining parameter fields
ArgumentErrorException
- on error in data
java.lang.IllegalArgumentException
- on error in processing
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |