java.lang.Object | |
↳ | com.pnfsoftware.jeb.util.interpreter.AbstractCommandHandler |
Skeleton for a command handler.
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From interface
com.pnfsoftware.jeb.util.interpreter.ICommandNode
|
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected String | help | ||||||||||
protected String | helpDetails | ||||||||||
protected String | name | ||||||||||
protected List<CommandParameter> | params | ||||||||||
protected ICommandManager | parent |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractCommandHandler(ICommandManager parent, String name) | |||||||||||
AbstractCommandHandler(ICommandManager parent, String name, String help) | |||||||||||
AbstractCommandHandler(ICommandManager parent, String name, String[] paramNames, String help, String helpDetails) | |||||||||||
AbstractCommandHandler(ICommandManager parent, String name, CommandParameter[] params, String help, String helpDetails) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractCommandHandler | addParameter(String paramName) | ||||||||||
AbstractCommandHandler | addParameter(CommandParameter parameter) | ||||||||||
List<ICommandNode> | getChildren() | ||||||||||
String |
getHelp()
Retrieve a short help that describes the command
| ||||||||||
String |
getHelpDetails()
Give additional details (used when "help $command" is called).
| ||||||||||
String |
getName()
Retrieve the name of the command (used to invoke the command)
| ||||||||||
int | getOptions() | ||||||||||
static String |
getParameter(List<InputToken> tokens, int i)
Get a parameter.
| ||||||||||
int | getParameterIndex(String paramName, String prefix) | ||||||||||
static String |
getParameterSafe(List<InputToken> tokens, int i)
Get a parameter, never return null.
| ||||||||||
List<CommandParameter> |
getParameters()
Retrieve the list of parameters available for this command
| ||||||||||
ICommandManager |
getParent()
Retrieve the parent, that is, this node's manager.
| ||||||||||
static InputToken | getToken(List<InputToken> tokens, int i) | ||||||||||
InputToken[] |
parseInputToken(List<InputToken> tokens, boolean failOnErrors)
Assign the inputToken value in the same index as inner
CommandParameter list. | ||||||||||
InputToken[] | parseInputToken(List<InputToken> tokens) | ||||||||||
AbstractCommandHandler | setOptions(int options) | ||||||||||
String | toString() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | setHelp(String help) | ||||||||||
void | setName(String name) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
com.pnfsoftware.jeb.util.interpreter.ICommandHandler
| |||||||||||
From interface
com.pnfsoftware.jeb.util.interpreter.ICommandNode
|
Retrieve a short help that describes the command
Give additional details (used when "help $command" is called). Please provide the most details to help user: any trick, return format.
Retrieve the name of the command (used to invoke the command)
Get a parameter.
Get a parameter, never return null.
Retrieve the list of parameters available for this command
Assign the inputToken value in the same index as inner CommandParameter
list. Note
that the result array can have a bigger size than inner CommandParameter
list if the
last CommandParameter
item allow Multiple parameters.
failOnErrors | set to false if you allow missing parameter after a prefixed parameter (used for autocompletion) or missing mandatory parameters |
---|