| Modifier and Type | Class and Description |
|---|---|
class |
ParamParser.Param
Represents one parsed parameter specification.
|
| Constructor and Description |
|---|
ParamParser(String spec) |
| Modifier and Type | Method and Description |
|---|---|
Set<ParamParser.Param> |
getOptionFlags()
Get option flags.
|
List<ParamParser.Param> |
getParameters()
Get regular parameters, in expected order.
|
protected Parser<?> |
getParser(String typeName)
Convert parameter spec type name into a
Parser. |
String |
getUsage(String commandName)
Build a usage summary string.
|
Map<String,Object> |
parse(ParseSession session,
ParseContext ctx,
boolean complete)
Parse command line parameters.
|
public ParamParser(String spec)
public String getUsage(String commandName)
commandName - command namepublic Set<ParamParser.Param> getOptionFlags()
public List<ParamParser.Param> getParameters()
protected Parser<?> getParser(String typeName)
Parser.
The implementation in ParamParser supports all of the pre-defined types of FieldTypeRegistry
(identified by their names), plus word to parse a String containing one or more non-whitespace characters.
Subclasses should override as required to add additional supported types.
typeName - name of typeIllegalArgumentException - if typeName is unknownpublic Map<String,Object> parse(ParseSession session, ParseContext ctx, boolean complete)
Copyright © 2016. All rights reserved.