|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectnet.dpml.cli.commandline.Parser
A class that implements the Parser interface can parse a
String array according to the Groupspecified and return a
CommandLine.
| Constructor Summary | |
Parser()
|
|
| Method Summary | |
CommandLine |
parse(String[] arguments)
Parse the arguments according to the specified options and properties. |
CommandLine |
parseAndHelp(String[] arguments)
Parse the arguments according to the specified options and properties and displays the usage screen if the CommandLine is not valid or the help option was specified. |
void |
setGroup(Group group)
Sets the Group of options to parse against |
void |
setHelpFormatter(HelpFormatter helpFormatter)
Sets the HelpFormatter to use with the simplified parsing. |
void |
setHelpOption(Option helpOption)
Sets the help option to use with the simplified parsing. |
void |
setHelpTrigger(String helpTrigger)
Sets the help option to use with the simplified parsing. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Parser()
| Method Detail |
public CommandLine parse(String[] arguments)
throws OptionException
arguments - the command line arguments
OptionException - if there are any problems encountered while parsing the
command line tokens.
public CommandLine parseAndHelp(String[] arguments)
throws IOException
arguments - the command line arguments
IOException - if an error occurs while formatting helppublic void setGroup(Group group)
group - the group of options to parse againstpublic void setHelpFormatter(HelpFormatter helpFormatter)
helpFormatter - the HelpFormatter to use with the simplified parsingparseAndHelp(String[])public void setHelpOption(Option helpOption)
--help, -h and -? are often used.
helpOption - the help OptionparseAndHelp(String[])public void setHelpTrigger(String helpTrigger)
--help, -h and -? are often used.
helpTrigger - the trigger of the help OptionparseAndHelp(String[])
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||