public abstract class CommandManager
extends java.lang.Object
Command| Constructor and Description |
|---|
CommandManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract HelpTree.Node |
getHelp()
Get an object embodying the command line help for the commands managed
by this CommandManager.
|
protected static boolean |
isMatch(java.lang.String s1,
java.lang.String s2)
A convenience routine for subtypes to use to see if one string matches another.
|
protected static boolean |
isMatch(java.lang.String s1,
java.lang.String[] s2)
A convenience routine for subtypes to use to see if a string
matches one of a set of strings.
|
protected static boolean |
isPrefixMatch(java.lang.String arg,
java.lang.String prefix)
A convenience routine for subtypes to use to see if a string
matches a prefix string.
|
abstract boolean |
parseCommand(java.lang.String cmd,
java.util.ListIterator argIter,
CommandContext ctx)
Parse a command (and any arguments it might take).
|
public abstract HelpTree.Node getHelp()
public abstract boolean parseCommand(java.lang.String cmd,
java.util.ListIterator argIter,
CommandContext ctx)
throws Command.Fault
cmd - the command to be parsedargIter - an iterator from which to get any arguments that
might be required by the optionctx - a context object to use while parsing the commandCommand.Fault - if the command is recognized by this command manager
but could not be successfully parsed or otherwise handled.protected static boolean isMatch(java.lang.String s1,
java.lang.String s2)
s1 - A string, such as the command name, to be matcheds2 - Another string, such as a command name, to be matchedprotected static boolean isMatch(java.lang.String s1,
java.lang.String[] s2)
s1 - A string, such as the command name, to be matcheds2 - An array of strings, such as command names, to be matchedprotected static boolean isPrefixMatch(java.lang.String arg,
java.lang.String prefix)
arg - A string, such as the command name, to be matchedprefix - The prefix to be matchedCopyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved.