Interface ICommandNode
- All Known Subinterfaces:
ICommandHandler,ICommandManager
- All Known Implementing Classes:
AbstractCommandHandler,SimpleCommandManager
public interface ICommandNode
A command node, either a handler or a manager.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicate to the parser that quotes should be processed as any other char. -
Method Summary
Modifier and TypeMethodDescriptionexecute(List<InputToken> tokens) Execute the command.Get child command nodes.getHelp()Retrieve a short help that describes the commandgetName()Retrieve the name of the command (used to invoke the command)intGet parser and execution options for this node.Retrieve the parent, that is, this node's manager.
-
Field Details
-
QUOTES_AS_NORMAL_CHAR
static final int QUOTES_AS_NORMAL_CHARIndicate to the parser that quotes should be processed as any other char. It is the responsibility of theICommandNodeto validate arguments.- See Also:
-
-
Method Details
-
getName
String getName()Retrieve the name of the command (used to invoke the command)- Returns:
- the command name
-
getHelp
String getHelp()Retrieve a short help that describes the command- Returns:
- short help text
-
getOptions
int getOptions()Get parser and execution options for this node.- Returns:
- bit flags such as
QUOTES_AS_NORMAL_CHAR
-
getParent
ICommandManager getParent()Retrieve the parent, that is, this node's manager.- Returns:
- the parent manager, or null for a root node
-
getChildren
List<ICommandNode> getChildren()Get child command nodes.- Returns:
- child nodes, or an empty list for leaf nodes
-
execute
Execute the command.- Parameters:
tokens- command arguments- Returns:
- the execution result, or null if no command was executed
-