|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.util.CommandLineOptions
public class CommandLineOptions
A utility class for generating command line options
Field Summary | |
---|---|
(package private) java.io.PrintWriter |
errorWriter
|
(package private) java.util.Vector |
flags
|
(package private) java.util.Hashtable |
optionInfo
|
Constructor Summary | |
---|---|
CommandLineOptions()
|
Method Summary | |
---|---|
void |
addFlag(java.lang.String flag)
Adds the flag to list of available command line options |
void |
addFlag(java.lang.String flag,
java.lang.String comment)
Adds the flag to list of available command line options |
void |
addFlag(java.lang.String flag,
java.lang.String usageText,
java.lang.String comment)
Adds the flag to list of available command line options |
void |
addFlag(java.lang.String flag,
java.lang.String usageText,
java.lang.String comment,
boolean optional)
Adds the flag to list of available command line options |
java.util.Properties |
getOptions(java.lang.String[] args)
parses the arguments into a hashtable with the proper flag as the key |
void |
printHelp(java.io.PrintWriter pw)
|
void |
printUsage(java.io.PrintWriter pw)
|
void |
setComment(java.lang.String flag,
java.lang.String comment)
Sets a comment for the flag |
void |
setOptional(java.lang.String flag,
boolean optional)
Sets whether or not a given flag is optional |
void |
setUsageInfo(java.lang.String flag,
java.lang.String usage)
Sets the text to print after the flag when printing the usage line |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
java.util.Vector flags
java.util.Hashtable optionInfo
java.io.PrintWriter errorWriter
Constructor Detail |
---|
public CommandLineOptions()
Method Detail |
---|
public void addFlag(java.lang.String flag)
flag
- the flag to add as an available command line optionpublic void addFlag(java.lang.String flag, java.lang.String comment)
flag
- the flag to add as an available command line optioncomment
- a comment for the flagpublic void addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment)
flag
- the flag to add as an available command line optioncomment
- a comment for the flagusageText
- the text that appears after the flag in the
usage stringpublic void addFlag(java.lang.String flag, java.lang.String usageText, java.lang.String comment, boolean optional)
flag
- the flag to add as an available command line optioncomment
- a comment for the flagusageText
- the text that appears after the flag in the
usage stringoptional,
- when true, indicates that this flag is optionalpublic java.util.Properties getOptions(java.lang.String[] args)
public void setComment(java.lang.String flag, java.lang.String comment)
flag
- the flag to set the comment forcomment
- the comment to use when printing help for the given flagpublic void setOptional(java.lang.String flag, boolean optional)
flag
- the flag to set optionality foroptional
- the boolean indicating the optionality for the given flagpublic void setUsageInfo(java.lang.String flag, java.lang.String usage)
flag
- the flag to set the usage info forusage
- the usage textpublic void printUsage(java.io.PrintWriter pw)
public void printHelp(java.io.PrintWriter pw)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |