|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.cli.Parser
Parser
creates CommandLine
s.
Parser
Field Summary | |
private CommandLine |
cmd
commandline instance |
private Options |
options
current Options |
private List |
requiredOptions
list of required options strings |
Constructor Summary | |
Parser()
|
Method Summary | |
private void |
checkRequiredOptions()
Throws a MissingOptionException if all of the
required options are no present. |
protected abstract String[] |
flatten(Options opts,
String[] arguments,
boolean stopAtNonOption)
Subclasses must implement this method to reduce the arguments that have been passed to the parse
method. |
CommandLine |
parse(Options options,
String[] arguments)
Parses the specified arguments
based on the specifed Options . |
CommandLine |
parse(Options opts,
String[] arguments,
boolean stopAtNonOption)
Parses the specified arguments
based on the specifed Options . |
void |
processArgs(Option opt,
ListIterator iter)
|
private void |
processOption(String arg,
ListIterator iter)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private CommandLine cmd
private Options options
private List requiredOptions
Constructor Detail |
public Parser()
Method Detail |
protected abstract String[] flatten(Options opts, String[] arguments, boolean stopAtNonOption)
Subclasses must implement this method to reduce
the arguments
that have been passed to the parse
method.
opts
- The Options to parse the arguments by.stopAtNonOption
- specifies whether to stop
flattening when a non option has been encountered
public CommandLine parse(Options options, String[] arguments) throws ParseException
Parses the specified arguments
based on the specifed Options
.
parse
in interface CommandLineParser
options
- the Options
arguments
- the arguments
CommandLine
ParseException
- if an error occurs when parsing the
arguments.public CommandLine parse(Options opts, String[] arguments, boolean stopAtNonOption) throws ParseException
Parses the specified arguments
based on the specifed Options
.
parse
in interface CommandLineParser
arguments
- the arguments
stopAtNonOption
- specifies whether to stop
interpreting the arguments when a non option has
been encountered and to add them to the CommandLines
args list.opts
- the specified Options
CommandLine
ParseException
- if an error occurs when parsing the
arguments.private void checkRequiredOptions() throws MissingOptionException
Throws a MissingOptionException
if all of the
required options are no present.
MissingOptionException
public void processArgs(Option opt, ListIterator iter) throws ParseException
ParseException
private void processOption(String arg, ListIterator iter) throws ParseException
ParseException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |