|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.admin.cli.Parser
public class Parser
The Parser object is used to parse the
command line and verify that the command line is CLIP compliant.
| Field Summary | |
|---|---|
private boolean |
ignoreUnknown
|
private List<String> |
operands
|
private Collection<CommandModel.ParamModel> |
options
|
private ParameterMap |
optionsMap
|
private static LocalStringsImpl |
strings
|
| Constructor Summary | |
|---|---|
Parser(String[] args,
int start,
Collection<CommandModel.ParamModel> options,
boolean ignoreUnknown)
Parse the given command line arguments |
|
| Method Summary | |
|---|---|
List<String> |
getOperands()
Returns the list of operands. |
ParameterMap |
getOptions()
Returns a Map with all the options. |
private CommandModel.ParamModel |
lookupLongOption(String s)
Get ParamModel for long option name. |
private CommandModel.ParamModel |
lookupShortOption(char c)
Get ParamModel for short option name. |
private static boolean |
optionRequiresOperand(CommandModel.ParamModel opt)
Does this option require an operand? |
private void |
parseCommandLine(String[] argv,
int start)
Parse the command line arguments according to CLIP. |
private void |
setOption(CommandModel.ParamModel opt,
String value)
Set the value for the option. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private ParameterMap optionsMap
private List<String> operands
private Collection<CommandModel.ParamModel> options
private boolean ignoreUnknown
private static final LocalStringsImpl strings
| Constructor Detail |
|---|
public Parser(String[] args,
int start,
Collection<CommandModel.ParamModel> options,
boolean ignoreUnknown)
throws CommandValidationException
args - command line argumentsstart - index in args to start parsingoptions - the valid options to consider while parsingignoreUnknown - if true, unknown options are considered operands
instead of generating an exception
CommandValidationException - if command line parsing fails| Method Detail |
|---|
private void parseCommandLine(String[] argv,
int start)
throws CommandValidationException
argv - command line arguments
CommandValidationException - if command line is invalidpublic ParameterMap getOptions()
public List<String> getOperands()
public String toString()
toString in class Objectprivate CommandModel.ParamModel lookupLongOption(String s)
private CommandModel.ParamModel lookupShortOption(char c)
private static boolean optionRequiresOperand(CommandModel.ParamModel opt)
private void setOption(CommandModel.ParamModel opt,
String value)
throws CommandValidationException
CommandValidationException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||