public final class CLArgsParser extends Object
ParserControl
,
CLOption
,
CLOptionDescriptor
Constructor and Description |
---|
CLArgsParser(String[] args,
CLOptionDescriptor[] optionDescriptors)
Create a parser that deals with options and parses certain args.
|
CLArgsParser(String[] args,
CLOptionDescriptor[] optionDescriptors,
ParserControl control)
Create a parser that can deal with options and parses certain args.
|
Modifier and Type | Method and Description |
---|---|
CLOption |
getArgumentById(int id)
Retrieve the
CLOption with specified id, or null
if no command line option is found. |
CLOption |
getArgumentByName(String name)
Retrieve the
CLOption with specified name, or null
if no command line option is found. |
Vector<CLOption> |
getArguments()
Retrieve a list of options that were parsed from command list.
|
String |
getErrorString()
Retrieve an error message that occurred during parsing if one existed.
|
String[] |
getUnparsedArgs()
Retrieve an array of arguments that have not been parsed due to the
parser halting.
|
public CLArgsParser(String[] args, CLOptionDescriptor[] optionDescriptors, ParserControl control)
args
- the args, typically that passed to the
public static void main(String[] args)
method.optionDescriptors
- the option descriptorscontrol
- the parser control used determine behaviour of parserpublic CLArgsParser(String[] args, CLOptionDescriptor[] optionDescriptors)
args
- the argsoptionDescriptors
- the option descriptorspublic final String[] getUnparsedArgs()
public final Vector<CLOption> getArguments()
public final CLOption getArgumentById(int id)
CLOption
with specified id, or null
if no command line option is found.public final CLOption getArgumentByName(String name)
CLOption
with specified name, or null
if no command line option is found.public final String getErrorString()
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.