public class CommandParser
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
CommandParser.Fault
Thrown when a bad command line argument is encountered.
|
Constructor and Description |
---|
CommandParser(CommandManager[] mgrs)
Create a parser to parse the commands accepted by a set of command managers.
|
Modifier and Type | Method and Description |
---|---|
void |
parse(java.lang.String[] args,
boolean urlEncoded,
CommandContext ctx)
Parse command line arguments into a series of commands.
|
void |
parse(java.lang.String[] args,
CommandContext ctx)
Parse command line arguments into a series of commands.
|
public CommandParser(CommandManager[] mgrs)
mgrs
- the command managers for the commands that can be parsedpublic void parse(java.lang.String[] args, CommandContext ctx) throws CommandParser.Fault
args
- the args to be parsedctx
- the context in which to store the commands that are createdCommandParser.Fault
- if there are any problems with a command that is parsed,
such as missing or inappropriate optionspublic void parse(java.lang.String[] args, boolean urlEncoded, CommandContext ctx) throws CommandParser.Fault
args
- the args to be parsedurlEncoded
- whether or not the args have been encoded according to the
"application/x-www-form-urlencoded" MIME format.ctx
- the context in which to store the commands that are createdCommandParser.Fault
- if there are any problems with a command that is parsed,
such as missing or inappropriate optionsCopyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved.